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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-02-09 (00:02)
From: Alessandro Baretta <alex@b...>
Subject: Re: [Caml-list] ref

altavillasalvatore@libero.it wrote:

> f,g := a;
> !f, !g ;;

You are asking too much of the assignment operator. You must 
remember that Ocaml does not support operator overloading, 
so you cannot define a
val (:=) : 'a ref -> 'a -> unit

and a
val (:=) : ('a * 'b) ref -> ('a * 'b) -> unit

This would require a form of "generic overloading" of (:=) 
over all tuple types. This is really a little too much, I think.

BTW, are you sure you need references?

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners