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.3 required=5.0 tests=SPF_FAIL 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 EC8D9BC0B for ; Wed, 31 Jan 2007 08:04:25 +0100 (CET) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0V74PQ2013697 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Wed, 31 Jan 2007 08:04:25 +0100 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HC9Vr-0004lN-5h for caml-list@inria.fr; Wed, 31 Jan 2007 08:04:11 +0100 Received: from bas1-montreal42-1242409190.dsl.bell.ca ([74.13.168.230]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 31 Jan 2007 08:04:11 +0100 Received: from monnier by bas1-montreal42-1242409190.dsl.bell.ca with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 31 Jan 2007 08:04:11 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Stefan Monnier Subject: Re: Equality of functional values Date: Wed, 31 Jan 2007 02:03:53 -0500 Message-ID: References: <1170104645.4564.304.camel@penguin.local> <45BF471A.6060603@fmf.uni-lj.si> <1170165303.6391.20.camel@rosella.wigram> <45BFCF7D.5010302@fmf.uni-lj.si> <45BFDF8C.20609@mcmaster.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bas1-montreal42-1242409190.dsl.bell.ca User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux) Cancel-Lock: sha1:qQGYZdbIX4Vpw3Ug6Ejhp+MjJ+o= Sender: news X-Miltered: at discorde with ID 45C03F79.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 pointer:01 ocaml:01 sml:01 intentional:01 expansions:01 flattening:01 equality:01 equality:01 compile:01 argument:02 functional:02 logic:04 meant:06 identical:06 > I really meant 'Intensional equality', in other words, if they are the same > as far as the system is concerned (in a logic this usually this means the > same syntactically, but in the case of ocaml that would be pointer > equality). I don't know what the OCaml optimizer may do, but I do know that in SML/NJ such an intentional equality would often not give the expected result, because it's pretty common for it to use various forms of eta-like expansions in the hope of doing uncurrying or argument flattening, so you may end up with f == f turned into (λx1.λx2.f(x1,x2)) == (λy1.λy2.f(y1,y2)) and the system may not try to recognize that the two lambda-expressions are identical (too costly an analysis for no performance benefit), so it will compile them to two different pieces of machine language. Stefan