Blocks in g++ ?
Per Bothner
bothner@pacbell.net
Thu Jun 10 09:19:00 GMT 1999
Joern Rennecke <amylaar@cygnus.co.uk> writes:
> > argument to a function. the special bit about blocks is that they are
> > executed by the called function, but they are parsed in the context of
> > where they are defined. so you have access to local variables etc...
>
> Look in extend.texi for 'Nested Functions' .
It is worth pointing out that blocks, if implemented as lexical closures
as is the de facto Smalltalk standard, are much more powerful than Gcc's
nested functions, since the latter do *not* create proper closures.
(Creating closures is probably not practical unless you have garbage
collection.)
--
--Per Bothner
bothner@pacbell.net http://home.pacbell.net/bothner/
More information about the Gcc
mailing list