OCaml Array Confusion

The section of the OCaml manual gives details about OCaml blocks: https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#s:c-value

An array is the address of a block, and this is not just the address of the first cell of data but also where the length of the block and the kind of block (tag) is stored. The length and tag are needed for a few things, one of them being bound checking. That’s why OCaml doesn’t offer the notion of reference or pointer to some position in an array. For the correct details, see the link above. :slight_smile:

1 Like