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 C568FBDE6 for ; Thu, 8 Sep 2005 18:45:08 +0200 (CEST) Received: from mail.davidb.org (adsl-64-172-240-129.dsl.sndg02.pacbell.net [64.172.240.129]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j88Gj6eu031699 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 8 Sep 2005 18:45:08 +0200 Received: from a64.davidb.org ([192.168.1.23]) by mail.davidb.org with esmtpa (Exim 4.50 #1 (Debian)) id 1EDPWL-0007cY-3r; Thu, 08 Sep 2005 09:45:05 -0700 Subject: Re: [Caml-list] The Caml morale crasher #1 From: David Brown To: padator@wanadoo.fr Cc: caml-list , Damien Guichard , Florian Weimer In-Reply-To: <9504834.1126184133428.JavaMail.www@wwinf1536> References: <9504834.1126184133428.JavaMail.www@wwinf1536> Content-Type: text/plain Date: Thu, 08 Sep 2005 09:44:53 -0700 Message-Id: <1126197893.3685.7.camel@a64.davidb.org> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 43206A92.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 implements:01 stack:01 enclosing:01 implements:01 stack:01 pointer:01 downward:98 downward:98 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=FORGED_RCVD_HELO,SPF_SOFTFAIL autolearn=disabled version=3.0.3 On Thu, 2005-09-08 at 14:55 +0200, yoann padioleau wrote: > > * Damien Guichard: > > > > > 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". > > > > Most languages offer strictly downward closures. Even GCC's C > > implementation has them. 8-) > > 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 closure is something > that close his environment and store it somewhere. There is no such thing in GCC I think. GCC definitely implements downward closures. You can take the address of nested functions, and as long as the stack frame is still valid, they have access to values defined in the enclosing function. GCC implements this by generating trampolines on the stack and passing the address of the newly generated code as the function pointer. It fails to work on platforms that have security features that prevent stack execution. Dave