Lazy evaluation

Lutger lutger.blijdestijn at gmail.com
Wed Jun 27 15:00:24 PDT 2007


BCS wrote:
> Lutger wrote:
>> BCS wrote:
>>
>>> OF wrote:
>>>
>>>> It hints at lazyexp not being valid after the function has ended, 
>>>> which makes it quite different from delegates.
>>>
>>>
>>> This is the /exact/ behavior of delegate liters and delegates formed 
>>> from nested functions. They are invalid after the function call they 
>>> are from returns. This is because the delegate caries a pointer to 
>>> the stack frame of the surrounding function.
>>
>>
>> Yeah, but only when you access some variables through this pointer right?
> 
> I would assume so but there might be some hidden reads that could cause 
> problems.

Could you elaborate? I see nothing in the spec that says it's legal or 
not. If there are problems with this, I think that should be clearly 
stated.



More information about the Digitalmars-d mailing list