English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] variant with tuple arg in pattern match?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-04-10 (02:53)
From: Patrick M Doane <patrick@w...>
Subject: Re: [Caml-list] variant with tuple arg in pattern match?
On Sun, 8 Apr 2001, Pierre Weis wrote:

> I would suggest the other way round: as we already did for functions,
> we should prefer the curried syntax for constructors.
> I suggest to explicitely annotate the constructor definitions as in:
> type t =
> | C : int -> int -> t

I really like this!  You mentioned in later e-mails that this would leave
pattern matching unaffected. I assume it should also be possible to
consider the constructor as a higher-order function usable in any
location that a variable is currently allowed.

I think it is good to have these syntax discussions from time to time. 
Obviously it should not be the main focus of attention, but syntax really
matters for the first impressions a user has with a new programming


To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr