Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the "revised syntax" in OCaml?

Tags:

ocaml

camlp4

When people refer to the "revised syntax" in OCaml, do they mean that this will become a new syntax for the language, or is it just an alternative syntax created in CamlP4? If it's the former, then when does the "revised syntax" become the "official syntax" of OCaml?

like image 288
aneccodeal Avatar asked May 26 '10 23:05

aneccodeal


2 Answers

The revised syntax is just an alternative to the original that is implemented in Camlp4/5 (there is also a Lisp syntax written in Camlp5). Some people prefer it, but I would discourage you from using it as it's only likely to make your code more confusing for other OCaml programmers. One place it's valuable to know the revised syntax is when you're writing Camlp4/5 extensions---the revised syntax is used for patterns and rewrites, probably because it's somewhat more consistent than the original.

As far as I know, there is no plan to replace the original OCaml syntax with the revised syntax.

like image 140
Chris Conway Avatar answered Sep 21 '22 20:09

Chris Conway


This is just an alternative concrete syntax. I think that's just to demonstrate how powerful camlP4 is, a kind of proof of concept.

like image 22
LB40 Avatar answered Sep 22 '22 20:09

LB40