Skip to content

Grammar inconsistencies

def-lkb edited this page Oct 7, 2013 · 9 revisions

Document known differences between OCaml and Camlp4. Merlin will follow OCaml syntax.

0-uple

# type t = ()

Accepted by ocaml.
Rejected by camlp4.

"()" in an expression context is quite ambiguous after such definitions.

functions in labelled arguments

# let f x = f ~f:fun x -> x;;

Rejected by ocaml.
Accepted by camlp4.

variant extension

# type t = [variants];;

Rejected by ocaml.
Accepted by camlp4.