function'' no longer exists. One must use
only ``fun''.fun'',
``match'' and ``try'' are closed with brackets: an open
bracket ``['' before the first case, and a close bracket
``]'' after the last one:
| Ocaml | Revised |
|---|---|
| match e with | match e with |
| p1 -> e1 | [ p1 -> e1 |
| | p2 -> e2;; | | p2 -> e2 ]; |
| fun x -> x;; | fun [x -> x]; |
| Ocaml | Revised |
|---|---|
| fun x -> x | fun x -> x |
| fun {foo=(y, _)} -> y | fun {foo=(y, _)} -> y |
fun'', but
only with irrefutable patterns:
| Ocaml | Revised |
|---|---|
| fun x (y, z) -> t | fun x (y, z) -> t |
| fun x y (C z) -> t | fun x y -> fun [C z -> t] |
Match_failure'' whichever parameter is
applied, the empty ``match'', raising ``Match_failure'' after
having evaluated its expression, and the empty ``try'', equivalent to
its expression without try:
fun []
match e with []
try e with []
let'' and ``value'' must be
irrefutable. The following Ocaml expression:
let f (x::y) = ...
must be written in Revised:
let f = fun [ [x::y] -> ...
where'' is back, but one can write only
one bind:
e where x = y
but not:
e where x = y and z = t