Most of the CameLIGO syntax follows the OCaml syntax, however, there are a few syntactic shortcuts available in one but not the other.
Consecutive '-' operators
In OCaml, you can do :
But this has been forbidden in CameLIGO, you have to add parentheses instead:
Unary '+' operator
This is possible in OCaml but not CameLIGO :
'type in' statements
In CameLIGO, you can declare types locally to an expression. For example, here is a function returning a list of integers :
begin ... end sequences
In OCaml, the last instruction of a
begin ... end sequence can be terminated by a semicolon
;, but not in CameLIGO.
Name punning permits record assignments without repeating the right-hand side if it is the same as the record field name. Although possible in OCaml, this is not yet avaiable in CameLIGO.