reference to 'self' inside a function

Kevin Cox kevincox.ca at gmail.com
Tue Jul 17 10:09:09 PDT 2012


On Jul 17, 2012 1:00 PM, "angel" <andrey.gelman at gmail.com> wrote:
>
> I propose to introduce a reference to the current function, much like
'this' in a class method. Call it 'self' or 'thisFunc', or whatever ...
> What might this be good for ?
> For implementing recursion in a lambda function.
> Writing in functional style, one creates many functions, and looking for
reasonable names for these functions becomes unnecessarily painful.

I like that idea, although I don't know about the name.  We also might want
more features such as access to syntacticly nested functions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120717/7018268b/attachment.html>


More information about the Digitalmars-d mailing list