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
Re: [Caml-list] Feature request : Tuples vs. records
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-02-23 (16:32)
From: Lukasz Stafiniak <lukstafi@g...>
Subject: Re: [Caml-list] Feature request : Tuples vs. records
On 2/23/07, Jon Harrop <jon@ffconsultancy.com> wrote:
> On Thursday 22 February 2007 16:16, David Teller wrote:
> > I'm more concerned about having to
> > * declare every record type I use -- that looks to me clumsy and Java-like
> > * differenciate between records and tuples during pattern-matching
> The same can be said of ordinary and polymorphic variants. You must declare
> ordinary variants. You must distinguish between the two in patterns.
You can define a syntax extension to translate (note you can use your
preferred syntax):

`{x=u; y=v; z=w}
object val x=u val y=v val z=w method x=x method y=y method z=z end