override(T)

bearophile bearophileHUGS at lycos.com
Thu Sep 24 08:52:55 PDT 2009


> Something that may be useful, partially related:
> http://en.wikipedia.org/wiki/Multiple_dispatch
> http://en.wikipedia.org/wiki/Generic_function

Something similar to the CLisp syntax looks good enough for D (I think there's no need to add an explicit mark that reminds there's some runtime cost to be paid in this calls):
void collideWith(Asteroid x, Asteroid y) { ...}
void collideWith(Asteroid x, Spaceship y) { ...}
...

Bye,
bearophile



More information about the Digitalmars-d mailing list