-
Notifications
You must be signed in to change notification settings - Fork 234
Grammar inconsistencies
def-lkb edited this page Oct 13, 2014
·
9 revisions
Document known differences between OCaml and Camlp4. Merlin will follow OCaml syntax.
# type t = ()
Accepted by ocaml.
Rejected by camlp4.
"()" in an expression context is quite ambiguous after such definitions.
# let f x = f ~f:fun x -> x;;
Rejected by ocaml.
Accepted by camlp4.
# type t = [variants];;
Rejected by ocaml.
Accepted by camlp4.
# let _ : type = value;;
Rejected by ocaml.
Accepted by camlp4.
# let (_ : type) = value;;
# let _id : type = value;;
Accepted by both ocaml and camlp4.
# let ( :=> ) = value;;
Rejected by ocaml.
Accepted by camlp4.
# "" ^ if true then (); "";;
Rejected by ocaml.
Accepted by camlp4.
# List.(1;2)
Accepted by ocaml. Rejected by camlp4.
Spotted by obad.
# 4; + 5;;
Accepted by camlp4 (evaluates to 9!). Rejected by ocaml.