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
[Caml-list] syntaxes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-10-07 (07:06)
From: Pierre Weis <pierre.weis@i...>
Subject: Re: [Caml-list] syntaxes
> >> Sometimes SML solution is shorter.
> >For example?
> pattern matching in function head...
> Gergo
> +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+
> |         Email:,          |
> |  URL:    Mobile: (+36 20) 356 9656     |
> +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+

This has been reported many times as such, but:

1) Semantically, this is not as clear as Caml's ``function'' construct.

2) You have to carefully count characters before stating that pattern
matching in function head is shorter! Very often, functions using
pattern matching have many cases, and repeating the function name for
each clause is a burden and a lot more typing.

3) We already had this feature in Caml in the past. When we suppressed
it, nobody complained at the time: I suspect that serious Caml's users
(those that write in the mailing lists to complain and ask for new
features) never used ``pattern matching in function head''.

In my mind ``pattern matching in function head'' is a typical
``programming in the small'' feature: it is useful for beginners
and/or small functions with only 2 or 3 cases but useless for huge
pattern matchings.

Once more Caml has a tendency to favour programming in the large.

Pierre Weis

INRIA, Projet Cristal,,

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: