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 MAA07275; Fri, 23 May 2003 12:13:51 +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 MAA07269 for ; Fri, 23 May 2003 12:13:50 +0200 (MET DST) Received: from mail.exomi.com (mail.exomi.com [217.169.64.72]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h4NADnH07082 for ; Fri, 23 May 2003 12:13:49 +0200 (MET DST) Received: from exomi.com (oxy.exomi.com [10.0.20.56]) by mail.exomi.com (Postfix) with ESMTP id D3A465D03; Fri, 23 May 2003 13:13:48 +0300 (EEST) Date: Fri, 23 May 2003 13:13:48 +0300 Subject: Re: [Caml-list] Why are arithmetic functions not polymorph? Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) Cc: hermanns , caml-list@inria.fr To: David Monniaux From: Ville-Pertti Keinonen In-Reply-To: Message-Id: <3E718B87-8D07-11D7-A8E8-000393863F70@exomi.com> Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.552) X-Spam: no; 0.00; caml-list:01 inference:01 val:01 inconsistent:01 overloading:01 int:01 arithmetic:01 sml:01 functions:05 integer:06 overloaded:06 type:07 1.0,:08 operations:08 something:09 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > SML has a kind of operator overloading, but I don't know the details. They're overloaded up to the point of type inference, after which they become integer operations. I think it's better not to have something as inconsistent as SML. This works: - op +; val it = fn : int * int -> int - op + (1.0, 2.0); val it = 3.0 : real This doesn't: - val myadd = op +; val myadd = fn : int * int -> int - myadd (1.0, 2.0); ------------------- 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