Version française
Home     About     Download     Resources     Contact us    
Browse thread
RE: [Caml-list] operator overloading
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Issac Trotts <ITrotts@I...>
Subject: RE: [Caml-list] operator overloading
I would agree that C++'s operator overloading is a little warty,
but it's easy enough use.  

Maybe it would be possible to extend OCaml's odd idea of using 
different looking operators for different types.  For instance, 
3D vector operations could be done like this:

	a +^ b (* add *)
	a -^ b (* subtract *)
	a .^ b (* dot product *)
	a ^^ b (* cross product, or maybe wedge product *)

Matrix operations could be done with #'s after the operators.
Spinor ops could be suffixed with @s, etc.  

Issac


> -----Original Message-----
> From: forsyth@caldo.demon.co.uk [mailto:forsyth@caldo.demon.co.uk]
> Sent: Saturday, April 13, 2002 2:44 AM
> To: caml-list@inria.fr
> Subject: RE: [Caml-list] operator overloading
> 
> 
> >>compared to
> >>the simple mechanism for overloading operators in C++.
> >>It would be nice to see something more straightforward.
> 
> i think it's the first time i've seen operator overloading in 
> C++ described
> as a `simple mechanism'.
> 
> -------------------
> 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



-------------------
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