Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] The Caml morale crasher #1
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Brown <caml@d...>
Subject: Re: [Caml-list] The Caml morale crasher #1
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