Does D have too many features?

David Nadlinger see at klickverbot.at
Sun Apr 29 06:24:40 PDT 2012


On Sunday, 29 April 2012 at 12:41:37 UTC, Paulo Pinto wrote:
> I am not arguing to remove the feature, rather to have the 
> compiler check it for me. Surely it can see if I am passing the 
> delegate to D code or extern C/C++ code and act accordingly.

How would this work? Function pointers are only a single word in 
D code as well (and a single unconditional jump to that address) 
, whereas delegates are two words. What is if a function accepts 
a delegate, but a function pointer is passed? What is if a 
delegate is passed to a (possibly C) function – does the 
compiler automatically emit a thunk for that?

David


More information about the Digitalmars-d mailing list