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 SAA22766; Fri, 23 May 2003 18:34:54 +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 SAA22834 for ; Fri, 23 May 2003 18:34:52 +0200 (MET DST) Received: from grace.speakeasy.org (grace.speakeasy.org [216.254.0.2]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id h4NGYoT23852 for ; Fri, 23 May 2003 18:34:51 +0200 (MET DST) Received: (qmail 24305 invoked by uid 36130); 23 May 2003 16:34:49 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 23 May 2003 16:34:49 -0000 Date: Fri, 23 May 2003 09:34:49 -0700 (PDT) From: brogoff@speakeasy.net To: David Monniaux cc: hermanns , "caml-list@inria.fr" Subject: Re: [Caml-list] Why are arithmetic functions not polymorph? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam: no; 0.00; brogoff:01 caml-list:01 monniaux:01 operands:01 runtime:01 gcaml:01 3.07:01 hash:01 extensional:01 generics:01 abominable:01 speakeasy:01 overloading:01 arithmetic:01 sml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 23 May 2003, David Monniaux wrote: [... nice explanations snipped ...] > - short of a significant change in the type system, +, -, *, / would not > refuse non-arithmetic operands, but would throw exceptions at runtime if > applied to non-arithmetic arguments. GCaml, which will be resurrected after 3.07 is released, is just such an extension to the type system. It would also allow using + for string concatenation, or using the arithmentic operators for set operations. Given the ability to control syntax, it would also enable one to use array syntax to access hash tables or maps, or string accesses. I believe that the desire to do this was discussed some time ago in the context of extensional polymorphism (i.e., GCaml generics) but the syntactic issue was ignored. > SML has a kind of operator overloading, but I don't know the details. SML doesn't allow the user to define overloadings, and that is an abomination. Java is similarly abominable. -- Brian ------------------- 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