From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id AAA00365 for caml-redistribution; Mon, 8 Jan 1996 00:49:13 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id WAA01359 for ; Fri, 5 Jan 1996 22:14:20 +0100 Received: from margaux.inria.fr (margaux.inria.fr [128.93.8.2]) by concorde.inria.fr (8.7.1/8.7.1) with ESMTP id WAA15880 for ; Fri, 5 Jan 1996 22:14:20 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by margaux.inria.fr (8.6.10/8.6.6) with ESMTP id WAA06424 for ; Fri, 5 Jan 1996 22:14:18 +0100 Received: from rs1.hrz.th-darmstadt.de (rs1.hrz.th-darmstadt.de [130.83.22.60]) by concorde.inria.fr (8.7.1/8.7.1) with SMTP id WAA15874 for ; Fri, 5 Jan 1996 22:14:15 +0100 (MET) Received: from crunch (crunch.ikp.physik.th-darmstadt.de [130.83.24.4]) by rs1.hrz.th-darmstadt.de (8.6.12/8.6.12.0ms) with SMTP id WAA16204; Fri, 5 Jan 1996 22:14:08 +0100 Received: by crunch (AIX 3.2/UCB 5.64/Client-1.5/HRZ-THD) id AA03157; Fri, 5 Jan 1996 22:14:07 +0100 Date: Fri, 5 Jan 1996 22:14:07 +0100 Message-Id: <9601052114.AA03157@crunch> From: Thorsten Ohl To: Pierre Weis Cc: caml-list@margaux.inria.fr Subject: Re: entiers et reels In-Reply-To: <199601051827.TAA27239@pauillac.inria.fr> References: <9601050905.AA05343@audrey.enst-bretagne.fr> <199601051827.TAA27239@pauillac.inria.fr> Sender: weis >>>>> "Pierre" == Pierre Weis writes: Pierre> En revanche il n'y a pas de sens raisonable a` une addition Pierre> polymorphe, et c'est pourquoi nous avons une collection Pierre> d'additions monomorphes. [ No, I'm not going to embarrass myself by trying to respond in French ... :-) ] Maybe I'm too dense or I have been exposed to too much Fortran, but I don't fully understand: Standard ML has it (at least in the New Jersey incarnation), so why can't Caml? As long as all operands are of the same type, the semantics should be obvious. I agreee that promotion will open a can of worms (standard example: (1/2)*2.0 would most likely evaluate to 0.0, which is even more likely _not_ what the programmer intended). But wouldn't it be possible to assign types to subexpressions based on the context in such a way that no information can be lost? I asking out of curiosity, but from the user's perspective I want to add that polymorphic arithmetic is just soooo convenient. It can be abused, but it can also make programs much more readable, if used with discretion. In particular if types have a natural inclusion (like natural, integer, rational, real and complex numbers). Also for vector spaces: it is usually not ambigious whether a scalar or an inner product is intended. Greetings, -Thorsten /// Thorsten Ohl, TH Darmstadt, Schlossgartenstr. 9, D-64289 Darmstadt, Germany //// http://crunch.ikp.physik.th-darmstadt.de/~ohl //// voice: +49-6151-16-3116 ///// email: Thorsten.Ohl@Physik.TH-Darmstadt.de /// secretary: 2072, fax: 2421