From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 815D2BBE1 for ; Thu, 12 Oct 2006 08:08:05 +0200 (CEST) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.229]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k9C6843M024840 for ; Thu, 12 Oct 2006 08:08:05 +0200 Received: by wx-out-0506.google.com with SMTP id s6so485575wxc for ; Wed, 11 Oct 2006 23:08:04 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QiYMalJqLF/vHq3f/Q8tyrxmWVVNNcm6ee1T+RvI+pXZX0Bm0U23JTkwCeJhwdUOF+V8yxQ4SmYw51XUqZ09zDeMf7xnMODZ6BU8xxQvFqZOhhgEApWkZQWO2QXVcWRRSiCq5BUc6BCfezpi5TTuw0XSqLkOl1hJTiaPxZvPk4E= Received: by 10.70.53.7 with SMTP id b7mr2274921wxa; Wed, 11 Oct 2006 23:08:04 -0700 (PDT) Received: by 10.70.122.8 with HTTP; Wed, 11 Oct 2006 23:08:03 -0700 (PDT) Message-ID: Date: Thu, 12 Oct 2006 19:08:03 +1300 From: "Jonathan Roewen" To: "Carlos Pita" Subject: Re: [Caml-list] Why + vs +. but "fake" parametric polymorphism for < Cc: "Jacques Garrigue" , caml-list@yquem.inria.fr In-Reply-To: <1160632737.7649.34.camel@monad> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1160630285.7649.18.camel@monad> <20061012.144518.115907516.garrigue@math.nagoya-u.ac.jp> <1160632737.7649.34.camel@monad> X-j-chkmail-Score: MSGID : 452DDBC4.001 on discorde : j-chkmail score : X : 0/20 1 X-Miltered: at discorde with ID 452DDBC4.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; parametric:01 polymorphism:01 inference:01 optimise:01 specifies:01 compiler:01 statically:01 compiler:01 cheers:01 beginner's:01 ocaml:01 bug:01 saber:98 respuestas:98 respuestas:98 That's correct. As showed, specifying types somewhere (as I did with the return type, and someone else did for a given parameter), type inference deduces the types of the parameters and return values, allowing it optimise. let f x y : =3D .... specifies the return type, or to annotate a parameter, use (x:) -- the parentheses are required, and is a placeholder for the type expression. On 10/12/06, Carlos Pita wrote: > > > Of course there is an overhead. But the compiler is clever enough to > > remove this overhead when the types of arguments are statically known. > > In particular this is true for floats. > > Oh, I see, so if I understand you it would be enough if I use an integer > literal somewhere or explicitly declare some variable as int so the > compiler can infer that the particular use of the comparison operator is > being passed integer operands and consequently inline an specific, > optimized-for-int, version of <. Am I wrong? > Cheers, > Carlos > > > > > > __________________________________________________ > Pregunt=E1. Respond=E9. Descubr=ED. > Todo lo que quer=EDas saber, y lo que ni imaginabas, > est=E1 en Yahoo! Respuestas (Beta). > =A1Probalo ya! > http://www.yahoo.com.ar/respuestas > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >