Anonymous user
Optional parameters: Difference between revisions
m
→{{header|OCaml}}: wiki link currying
(→{{header|Ruby}}: Ruby 2.0 is out now.) |
m (→{{header|OCaml}}: wiki link currying) |
||
Line 1,112:
=={{header|OCaml}}==
OCaml has optional named parameters. It is conventional to place a non-optional parameter after the optional parameters, because if the optional parameters were at the end, then if you don't provide them, it will just look like a partial application (because OCaml supports [[currying]]), resulting in a function which still expects the optional parameters.
<lang ocaml>let sort_table ?(ordering = compare) ?(column = 0) ?(reverse = false) table =
|