The future of lambda delegates

Sean Kelly sean at f4.ca
Wed Aug 16 15:51:56 PDT 2006


Sean Kelly wrote:
> Walter Bright wrote:
>> Sean Kelly wrote:
>>> The alternative would be to use a separate keyword for these 
>>> delegates, 'closure' or 'lambda' or some such, but that's potentially 
>>> confusing, and leaves anonymous delegates in an odd position.
>>
>> I *really* want to avoid having to do this. It's almost guaranteed 
>> that it'll be a rich source of bugs.
> 
> As an alternative, since it's really how the delegate is used that's at 
> issue, perhaps the programmer could simply be given a way to manually 
> "archive" the stack frame used by a delegate if he knows it will need to 
> be called asynchronously?

Upon further reflection (and some helpful criticism) this doesn't seem 
like it may not work so well with delegates from structs and classes. 
But I do like the general idea better than that of flagging the 
delegates upon declaration or something like that.  I don't suppose the 
idea could be somehow refined to eliminate these problems?


Sean



More information about the Digitalmars-d mailing list