From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id GAA22225; Sun, 14 Apr 2002 06:15:26 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id GAA21500 for ; Sun, 14 Apr 2002 06:15:24 +0200 (MET DST) Received: from idmc.idolminds.com ([207.174.143.98]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id g3E4FML23882 for ; Sun, 14 Apr 2002 06:15:22 +0200 (MET DST) To: "'forsyth@caldo.demon.co.uk'" Cc: "Caml-List (E-mail)" Received: From IDMC.IDOLMINDS.COM (207.174.143.98[207.174.143.98 port:4759]) by idmc.idolminds.comMail essentials (server 2.429) with SMTP id: <2487@idmc.idolminds.com>transfer for ; Sat, 13 Apr 2002 10:15:42 PM -0600 ;transfer smtpmailfrom X-MESINK_Inbound: 0 X-MESINK_MailForType: SMTP X-MESINK_SenderType: SMTP X-MESINK_Sender: ITrotts@IdolMinds.com X-MESINK_MailFor: caml-list@inria.fr Received: by IDMC with Internet Mail Service (5.5.2653.19)id <2VKXBN39>; Sat, 13 Apr 2002 22:15:42 -0600 From: Issac Trotts subject: RE: [Caml-list] operator overloading Date: Sat, 13 Apr 2002 22:15:36 -0600 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain;charset="iso-8859-1" x-receiver: caml-list@inria.fr x-sender: ITrotts@IdolMinds.com Content-Transfer-Encoding: Quoted-Printable MIME-Version: 1.0 Message-ID: <6367f2e500133507d2@[192.168.1.6]> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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: =09a +^ b (* add *) =09a -^ b (* subtract *) =09a .^ b (* dot product *) =09a ^^ 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