Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: -- (:)
From: Alessandro Baretta <alex@b...>
Subject: Re: [Caml-list] ref 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 Archives:
Bug reports: FAQ:
Beginner's list: