From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 9A6E2BC84 for ; Thu, 28 Apr 2005 20:20:40 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j3SIKe3u006145 for ; Thu, 28 Apr 2005 20:20:40 +0200 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 UAA08955 for ; Thu, 28 Apr 2005 20:20:39 +0200 (MET DST) Received: from qrnik.knm.org.pl (paf87.warszawa.sdi.tpnet.pl [217.96.225.87]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j3SIKcIN006132 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 28 Apr 2005 20:20:39 +0200 Received: from qrczak by qrnik.knm.org.pl with local (Exim 3.36 #1) id 1DRDcp-0007Nt-00 for caml-list@inria.fr; Thu, 28 Apr 2005 20:20:35 +0200 To: caml-list@inria.fr Subject: Re: [Caml-list] Changes on equality between 3.06 and 3.08.3 X-Face: .B/ouEO}=VFkSJWE}s0@!:diHI.Z,`m}AqK#Vjuscq(Vf1B}H[)v\9tBN}>AdP,QSRbhO]=v 3?;I+cN/Z0HKPm_Eg99/pFrU!WfpjgQ!z":>A~qt0^4):0-UuPB(6^>j!mN$)RIb)rRhXeK:+MLPW[ RVb7Kepvby-ww6_zci7Yy_@IrWW References: <20050428100252.GF31263@lami.univ-evry.fr> <4271122F.5090705@barettadeit.com> <20050428.190637.07633836.oandrieu@nerim.net> From: "Marcin 'Qrczak' Kowalczyk" Mail-Followup-To: caml-list@inria.fr Date: Thu, 28 Apr 2005 20:20:35 +0200 In-Reply-To: <20050428.190637.07633836.oandrieu@nerim.net> (Olivier Andrieu's message of "Thu, 28 Apr 2005 19:06:37 +0200 (CEST)") Message-ID: <87sm1a226k.fsf@qrnik.zagroda> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: "Marcin 'Qrczak' Kowalczyk" X-Miltered: at nez-perce with ID 42712978.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42712976.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 andrieu:01 andrieu:01 ijm:01 bool:01 pervasives:01 ocaml:01 equality:01 writes:01 closures:01 jussieu:01 functions:01 defined:02 external:02 external:02 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: Olivier Andrieu writes: > > # (==) (==) (==);; > > - : bool = false > > Probably because == is defined by an "external" in pervasives.ml, > not a regular function definition. So here, when you use (==), > you're building three closures. Two. OCaml materializes function objects corresponding to external functions each time they are used instead of once at the point of their definition (presumably because it assumes that usually they are not passed as first-class objects at all), but application of such function doesn't need the function object but jumps straight to its machine code. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/