[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| 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?
Alex
-------------------
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