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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id D5AE9BDCB for ; Thu, 8 Sep 2005 18:36:13 +0200 (CEST) Received: from ash25e.internode.on.net (ash25e.internode.on.net [203.16.214.182]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j88GaBp8030945 for ; Thu, 8 Sep 2005 18:36:13 +0200 Received: from rosella (ppp32-47.lns1.syd6.internode.on.net [59.167.32.47]) by ash25e.internode.on.net (8.12.9/8.12.6) with ESMTP id j88GZxwG030296; Fri, 9 Sep 2005 02:05:59 +0930 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] The Caml morale crasher #1 From: skaller To: padator@wanadoo.fr Cc: Florian Weimer , Damien Guichard , caml-list In-Reply-To: <9504834.1126184133428.JavaMail.www@wwinf1536> References: <9504834.1126184133428.JavaMail.www@wwinf1536> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-eeh/mC+W1uyDQDvFgQ/a" Date: Fri, 09 Sep 2005 02:35:59 +1000 Message-Id: <1126197359.19053.57.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 X-Miltered: at nez-perce with ID 4320687B.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 damien:01 ocaml:01 lambdas:01 gcc's:01 gcc:01 gcc:01 stack:01 func:01 stack:01 func:01 opcode:01 pointer:01 pointers:01 downward:98 X-Attachments: type="application/pgp-signature" name="signature.asc" X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 --=-eeh/mC+W1uyDQDvFgQ/a Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, 2005-09-08 at 14:55 +0200, yoann padioleau wrote: > > * Damien Guichard: > >=20 > > > When annoucing an OCaml project on a public forum i have been > > > advised to renunce lambdas because it would impede translation to "a > > > less obscure, more popular language". > >=20 > > Most languages offer strictly downward closures. Even GCC's C > > implementation has them. 8-) >=20 > Again I think I will disagree on the choice of your words :) > GCC has nested functions. I think that we can't call that a closure; a cl= osure is something > that close his environment and store it somewhere. There is no such thing= in GCC I think. My understanding is: Gcc has first class closures like this stack picture: closure: CALL FUNC stack frame here FUNC: POP FP // FP points at the stack frame Closure's are created by pushing the function address plus a "CALL" opcode on to the stack, the SP is then a pointer to the closure. Execute permission is required for the stack. Memory management of the thunks, also called trampolines, is completely automatic. The closures are valid if, and only if, they're on the call stack, Damiens 'downward closures': this means you can pass them as arguments but not return them, like pointers to any other local variable in C. --=20 John Skaller --=-eeh/mC+W1uyDQDvFgQ/a Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBDIGhtsRp8/9aGVGsRApbzAJoCouVlHyVxFDrHXM8JJMzaDXO2GQCgkaRj qjzn5SSV+IyUlRGzhCRHXCY= =ychU -----END PGP SIGNATURE----- --=-eeh/mC+W1uyDQDvFgQ/a--