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
(int * int) <> int*int ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-02-23 (23:04)
From: Frédéric_Gava <gava@u...>
Subject: Re: [Caml-list] (int * int) <> int*int ?
>I understand you're arguing that type constructors should work the same
It is just i think: the difference with int*int and (int*int) seems (to me)
a hack (but i am peraps an extremist ;-) )

>Well, maybe they should have.
I also do not know. Peraps another solution would be that
#type t= A of int*int
#let a=(1,2) in (A a)
works by automatically transforming "a": tag*(int*int) to tag*int*int...but
peraps it is too hard for just some little cases and it takes many memory
for the copy (ok, I can write let (a1,a2)=(1,2) in (A (a1,a2)) but it takes
much times...;-) )

>I'm not sure I'd like it if that was changed now, however.  Working code
wouldn't cease to work- it'd just be
>less memory efficient.  But you'd always have the extra reference, even if
>you didn't need it.

I understand your problem and i have no good solution :-(

Good night !