D2 full closure?

downs default_357-line at yahoo.de
Tue Jul 15 12:09:36 PDT 2008


BCS wrote:
> Reply to Walter,
> 
>> Frank Benoit wrote:
>>
>>> Is this output expected?
>>>
>> No, it's a bug. The output should be 0,1,2. Is it on bugzilla?
>>
> 
> What?!! The value for the delegates are copied at the point of the '&'?
> 
> That seems more like currying to me.
> 

No, the problem is something else.

Currently, closures are apparently formed with the function body.

However, in this case, it is reasonable to expect them to be instead formed with *the surrounding scope*, especially since, in the case of loops, it sort of behaves like a function being called anyway. (like a half-way cross between scope and function).

 --downs



More information about the Digitalmars-d mailing list