Re: Double-dispatch

2011-02-16 Thread Peter Alexander
On 13/02/11 9:32 PM, Sean Eskapp wrote: == Quote from bearophile (bearophileh...@lycos.com)'s article Sean Eskapp: Is there a nicer way to do this in D, or am I stuck with the same thing? Andrei has recently said no one needs double dispatch (in D) :-) So Andrei will be interested in

Re: Double-dispatch

2011-02-13 Thread Sean Eskapp
== Quote from bearophile (bearophileh...@lycos.com)'s article > Sean Eskapp: > > Is there a nicer way to do this in D, or am I stuck with the same thing? > Andrei has recently said no one needs double dispatch (in D) :-) So Andrei > will be interested in your use case. >

Re: Double-dispatch

2011-02-13 Thread bearophile
Sean Eskapp: > Is there a nicer way to do this in D, or am I stuck with the same thing? Andrei has recently said no one needs double dispatch (in D) :-) So Andrei will be interested in your use case. Bye, bearophile

Re: Double-dispatch

2011-02-13 Thread Lutger Blijdestijn
Sean Eskapp wrote: > I remember in C++, I had to do double-dispatch using the visitor pattern. > This is cumbersome, just because each subclass has to have the exact same > singly-dispatched code that looks like: > > void dispatch(Base& other) > { >other.dispatch(*t

Re: Double-dispatch

2011-02-13 Thread Simen kjaeraas
Sean Eskapp wrote: I remember in C++, I had to do double-dispatch using the visitor pattern. This is cumbersome, just because each subclass has to have the exact same singly-dispatched code that looks like: void dispatch(Base& other) { other.dispatch(*this); } Is there a nicer way t

Double-dispatch

2011-02-13 Thread Sean Eskapp
I remember in C++, I had to do double-dispatch using the visitor pattern. This is cumbersome, just because each subclass has to have the exact same singly-dispatched code that looks like: void dispatch(Base& other) { other.dispatch(*this); } Is there a nicer way to do this in D, or am I s