Re: [boost] Report from Berlin C++ Standards Committee meeting

[mailto:boost-bounces@lists.boost.org] 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. -Gary-

Powell, Gary wrote:
[mailto:boost-bounces@lists.boost.org] 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.
participants (2)
-
Neal Becker
-
Powell, Gary