Newbie initial comments on D language - delegate

Sean Kelly sean at f4.ca
Wed Jan 30 11:10:21 PST 2008


Walter Bright wrote:
> Edward Diener wrote:
>> Perhaps there are some implementation issues regarding this which I do
>> not understand but these should be overcome in order to present a single
>> interface to the callable concept. Perhaps this has been
>> discussed ad nauseam on this NG already, so please correct me if I do
>> not understand all the ramifications of uniting all callable types under
>> the single idea of 'delegate' while perhaps keeping 'function' around
>> merely for backward compatibility with old code until eventually it is
>> dropped.
> 
> To merge the two requires the generation of thunks at runtime to
> manipulate the parameters and calling convention. It's doable, but not
> simple.

Can't say I've thought this through, but what if delegates simply worked
for all functions with the extern (D) calling convention, regardless of
scope?  That would cover the vast majority of cases, and make other
calling conventions somewhat of a special case, which they are anyway.


Sean



More information about the Digitalmars-d mailing list