Why no multiple-dispatch?

Vladimir Panteleev via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Aug 24 17:20:24 PDT 2014


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


More information about the Digitalmars-d-learn mailing list