Does D have too many features?
Paulo Pinto
pjmlp at progtools.org
Sun Apr 29 07:09:22 PDT 2012
Am 29.04.2012 15:24, schrieb David Nadlinger:
> 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
Yes, that is what I had in mind. That is what is done in .NET as far as
I am aware.
More information about the Digitalmars-d
mailing list