How does D improve design practices over C++?

Jarrett Billingsley jarrett.billingsley at gmail.com
Fri Nov 7 21:32:18 PST 2008


On Fri, Nov 7, 2008 at 11:13 PM, Christopher Wright <dhasenan at gmail.com> wrote:
> Jarrett Billingsley wrote:
>>
>> I don't know if C# had them first or what, but the name.. fits
>> somewhat better there.  C#'s delegates are something like D's
>> delegates combined with a signals and slots implementation.  So you
>> can think of a delegate as not being a method itself, but rather a
>> representative to all the objects+methods that have subscribed to it.
>> It's still not really a good fit ;)  But you make do with what you
>> have.
>
> In C#, there is the event type (System.Event) and the delegate type
> (System.Delegate). A delegate is pretty much the same as it is in D. An
> event is a collection of delegates that can be called as one function. You
> can add and remove delegates from it.
>
> Delegates are used in the signals and slots implementation, but so what? You
> can get the same in D.

All I was trying to do was explain where the name "delegate" may have come from.



More information about the Digitalmars-d mailing list