From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 81D85BBAF for ; Fri, 12 Nov 2010 11:50:51 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArEEAFur3EyK54gDgWdsb2JhbACiURUBARYiIr5RhUoEileDDIgL X-IronPort-AV: E=Sophos;i="4.59,186,1288566000"; d="scan'208";a="78460885" Received: from rouge.crans.org ([138.231.136.3]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 12 Nov 2010 11:50:41 +0100 Received: from localhost (localhost.crans.org [127.0.0.1]) by rouge.crans.org (Postfix) with ESMTP id AD0C28443; Fri, 12 Nov 2010 11:50:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at crans.org Received: from rouge.crans.org ([10.231.136.3]) by localhost (rouge.crans.org [10.231.136.3]) (amavisd-new, port 10024) with LMTP id 9MX2DGrxjDIJ; Fri, 12 Nov 2010 11:50:39 +0100 (CET) Received: from [128.93.60.41] (aspirine.inria.fr [128.93.60.41]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by rouge.crans.org (Postfix) with ESMTPSA id 8378A8442; Fri, 12 Nov 2010 11:50:39 +0100 (CET) Message-ID: <4CDD1BFF.2050704@glondu.net> Date: Fri, 12 Nov 2010 11:50:39 +0100 From: =?ISO-8859-1?Q?St=E9phane_Glondu?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101030 Mnenhy/0.8.2 Icedove/3.0.10 MIME-Version: 1.0 To: Elnatan Reisner Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Pervasives.compare != Pervasives.compare References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; pervasives:01 pervasives:01 constructors:01 compiler:01 bytecode:01 command-line:01 cheers:01 steph:98 caml-list:01 closure:01 externals:02 partially:02 native:03 external:03 seems:03 Le 12/11/2010 06:57, Elnatan Reisner a écrit : > Playing around a bit more, I seemed to find that every time you access > an 'external' function, you get a distinct reference (is there a better > term?) to it. This seems a bit odd to me. Can someone explain? Think of externals as constructors: they are always fully applied internally. So when you partially apply one (or use it with no arguments), the compiler eta-expands it and generates a closure that eats the remaining arguments and call the external. You can use the -dinstr (in bytecode) or -S (in native code) command-line switch to see how things are actually compiled. Cheers, -- Stéphane