Why no multiple-dispatch?

Aerolite via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Aug 24 18:14:19 PDT 2014


On Monday, 25 August 2014 at 00:20:26 UTC, Vladimir Panteleev
wrote:
> On Sunday, 24 August 2014 at 23:42:51 UTC, Aerolite wrote:
>> So what seems to be the situation here?
>
> Hi Aerolite,
>
> I've never used multiple dispatch in any language, but from 
> looking at the C# syntax here[1]:
>
>> ReactSpecialization(me as dynamic, other as dynamic);
>
> You should be able to implement multiple dispatch yourself, 
> using the getOverloads trait, using this (or a similar) syntax:
>
>> dynamic!ReactSpecialization(me, other);
>
>   [1]: 
> http://blogs.msdn.com/b/shawnhar/archive/2011/04/05/visitor-and-multiple-dispatch-via-c-dynamic.aspx

Yep, very true. In fact I was looking at doing something like
this for the project I'm working on! :)

I just can't help but think that really, such a feature should be
at the language level. Naturally though, I do understand the want
and need to feature-freeze the language, and if the community
feels the effort outweighs the gain in this regard, so be it.


More information about the Digitalmars-d-learn mailing list