Newbie initial comments on D language - delegate

Janice Caron caron800 at googlemail.com
Wed Jan 30 05:44:54 PST 2008


On Jan 30, 2008 11:17 AM, Don Clugston <dac at nospam.com.au> wrote:
> >>     extern(C) void (*callback)(int,int);
>
> That's just 'function', using the hideous C syntax.

Yes, that is precisely my suggestion. I see that as an advantage, not
a disadvantage, because it would encourage people to use "delegate",
unless they absolutely couldn't.

All I'm saying is, if you're working in D alone, you can get along
just fine using "delegate" instead of "function", and therefore the
keyword "function" is unnecessary.

On the other hand, if you want to interface with C, then you shouldn't
be surprised if you have to use hideous C syntax.

So we /could/ ditch "function" and have one fewer keyword.



More information about the Digitalmars-d mailing list