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-22 (16:17)
From: David Teller <David.Teller@e...>
Subject: Re: [Caml-list] Feature request : Tuples vs. records
Frederic GAVA a écrit :
> Hi David,
> Another difference is that (If I remember) record of float are unboxed and not tuple of float. But perhaps it could be done.
I assume that's not a real difficulty. I might be wrong.
> Also, I do understand the true difference between write
> {x=1;y=2} (9 caracters) and (~x:1,~y:2) (11 caracters) except syntaxic one (I thinks that = is simpler that : which is more for type)

I grant you that it is syntactically shorter. So we can keep it as a 
syntactic shortcut.

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
* having to learn/teach two different implementations of what is 
essentially the same concept
* having to learn/teach that third meaning of operator = (the first one 
being comparison between values and the second one being its use in let 
x = ...).