Ocaml | Revised |
---|---|
1, "hello", World | (1, "hello", World) |
[
'' and ``]
''.
Their syntax is:
list | ::= | [ elem-list opt-cons ] |
elem-list | ::= | expression ; elem-list |
expression |
opt-cons | ::= | :: expression | (*empty*) |
::
'' and an expression, the whole being enclosed
by brackets.
Examples:
Ocaml | Revised |
---|---|
x::y | [x::y] |
[x; y; z] | [x; y; z] |
x::y::z::t | [x::[y::[z::t]]] |
x::y::z::t | [x; y; z :: t] |