Boost logo

Boost :

From: Neal Becker (ndbecker2_at_[hidden])
Date: 2006-04-13 15:06:56


Powell, Gary wrote:

>> [mailto:boost-bounces_at_[hidden]] On Behalf Of Peter Dimov
>> I was looking at the lambda papers recently and I came to the
>> conclusion that what we actually need is local functions. To
>> pick an example from
>> N1958:
>>
> I would like local functions in addition to lambda's as well. There is a
> very old paper that proposed it.
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/1993/
> X3J16/93-0088 WG21/N0295 [PS] [PDF]
> A proposal for Nested Functions
> John Max Skaller & Fergus Henderson
>
> It's a slightly different need though than the current C++ lambdas. The
> main difference is that with the current library lambda implementations
> you by default get access to all of the surrounding function's local
> variables mentioned in the lambda statement. With a nested function you
> have to bring them in via arguments etc.
>
> It's still a nice feature and you should check out this paper.
>

This reminds me of python. In earlier versions, functions did not nest
their scopes. This was later changed, and I believe it was a good move.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk