Feature Request: Change the delegate type to void[] data insteadofvoid*ptr.

BCS ao at pathlink.com
Thu Oct 4 08:54:09 PDT 2007


Reply to Downs,

> BCS wrote:
> 
>> Fun
>> Bar.opApply  <<<<<
>> Fun.foreachBody_1
>
> Again, you're missing something.
> The void[] data property I'm proposing does not contain the complete
> stack of the delegate. Since part of that stack (the delegate's)
> doesn't even EXIST when the delegate is created, this would be rather
> pointless. Instead, data references the stack area _outside_ of the 
> delegate that the delegate uses. So in this case, that would be Fun,
> directly followed by its foreach body; two parts of the stack which 
> indeed form a continuous area. I hope that clears things up.
> --downs

In between the Fun frame and the foreach frame is the opApply frame (or several 
frames). If you keep nesting function and passing delegate to arbitrary code 
to be called deeper in the stack, sooner or later, you get a gap of unknown 
size.





More information about the Digitalmars-d mailing list