This chapter describes language extensions and convenience features that are implemented in OCaml, but not described in the OCaml reference manual.
(Introduced in Objective Caml 3.00)
This extension provides syntactic sugar for getting and setting elements in the arrays provided by the Bigarray module.
The short expressions are translated into calls to functions of the Bigarray module as described in the following table.
expression | translation |
expr0.{ expr1} | Bigarray.Array1.get expr0 expr1 |
expr0.{ expr1} <- expr | Bigarray.Array1.set expr0 expr1 expr |
expr0.{ expr1, expr2} | Bigarray.Array2.get expr0 expr1 expr2 |
expr0.{ expr1, expr2} <- expr | Bigarray.Array2.set expr0 expr1 expr2 expr |
expr0.{ expr1, expr2, expr3} | Bigarray.Array3.get expr0 expr1 expr2 expr3 |
expr0.{ expr1, expr2, expr3} <- expr | Bigarray.Array3.set expr0 expr1 expr2 expr3 expr |
expr0.{ expr1, …, exprn} | Bigarray.Genarray.get expr0 [| expr1, … , exprn |] |
expr0.{ expr1, …, exprn} <- expr | Bigarray.Genarray.set expr0 [| expr1, … , exprn |] expr |
The last two entries are valid for any n > 3.