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 OAA22932; Sat, 14 Aug 2004 14:59:30 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA22482 for ; Sat, 14 Aug 2004 14:59:29 +0200 (MET DST) Received: from smtp.syd.swiftdsl.com.au (smtp.syd.swiftdsl.com.au [202.154.83.58]) by nez-perce.inria.fr (8.12.10/8.12.10) with SMTP id i7ECxNmL005432 for ; Sat, 14 Aug 2004 14:59:27 +0200 Received: (qmail 20882 invoked from network); 14 Aug 2004 12:59:24 -0000 Received: from unknown (HELO coltrane.mega-nerd.net) (218.214.64.136) by smtp.syd.swiftdsl.com.au with SMTP; 14 Aug 2004 12:59:24 -0000 Received: from coltrane (localhost [127.0.0.1]) by coltrane.mega-nerd.net (Postfix) with SMTP id 1C5467AE1 for ; Sat, 14 Aug 2004 22:59:20 +1000 (EST) Date: Sat, 14 Aug 2004 22:59:19 +1000 From: Erik de Castro Lopo To: caml-list@inria.fr Subject: [Caml-list] Infix operators Message-Id: <20040814225919.0bed9f65.ocaml-erikd@mega-nerd.com> Organization: Erik Conspiracy Secret Labs X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 411E0CAB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; brochure:99 compiler:01 sales:98 int:01 int:01 float:02 float:02 unix:02 nospam:97 back-end:03 infix:03 infix:03 types:03 let:04 let:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi all, I've got a number of defined types for which I'd like to define infix operators for addition, subtraction, multiplication etc. Unfortunately since each type needs is own infix operator I'm running out of ideas unique operator versions for each type. Why is it not possible to do something like: let ( ++ ) (a:float) (b:float) = a +. b ;; let ( ++ ) (a:int) (b:int) = a + b ;; which with the full type specification should allow the compiler to figure out which version to use in a given situation. Regards, Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ "An older MS internal whitepaper from August 2000 on switching Hotmail, which MS acquired in 1997, from front-end servers running FreeBSD and back-end database servers running Solaris to a whole farm running Win2K, reads like a veritable sales brochure for UNIX" -- http://www.theregister.co.uk/content/4/28226.html ------------------- 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