Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
RE: [Caml-list] Caml historical question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-01-15 (18:11)
From: Harrison, John R <johnh@i...>
Subject: RE: [Caml-list] Caml historical question
Hi Xavier,

| What is deprecated in OCaml, but was supported in Caml Light and Caml
| is multiple-case "fun":
|         fun pat11 ... patN1 -> expr1
|           | ...
|           | pat1M ... patNM -> exprM
| Although this form subsumes the previous two, the extra generality was
| rarely useful, and complex patterns have to be parenthesized so that
| the parser can figure them out.

I used it quite a lot in CAML Light, and had to uglify my code to get
the same effect in OCaml. It seems to me that the extra generality does
no harm, and sometimes makes code a bit shorter and clearer.

I can understand the need for separate "fun" and "function" to deal with
ambiguities when multiple adjacent patterns are in a match. But I don't
see any reason at all to restrict "fun" to a single case. Surely there
are no substantial parsing subtleties here that don't arise anyway in
other cases? There are clear delimiters "|" and "->" around each
(multiple) pattern.

Bug reports:  FAQ:
To unsubscribe, mail  Archives: