D 2.0 - dalegates to function

Lionello Lunesu lio at lunesu.remove.com
Thu Mar 1 23:20:47 PST 2007


Stewart Gordon wrote:
> Lionello Lunesu Wrote:
> 
> <snip>
>> There should be no reason for any thunking.  The calling 
>> convention should be made compatible: the context-pointer of a 
>> delegate should be put in a register that's simply ignored by 
>> functions (without context).
>>
>> Or am I missing something?
> 
> I think you're thinking of being able to convert functions to delegates, not vice versa which is what this thread is about.
> 
> Stewart.

Huh, I guess it is.. But it seems the others got it wrong, too :)

But how can a delegate ever get "thunked" to behave like a function? R 
delegate(X...) => R function(C,X...), with the C the context ?

I've had much need for passing function-pointers as delegates, but never 
the other way around.

L.



More information about the Digitalmars-d mailing list