[fpc-pascal] Re: double dispatch
Marco van de Voort
marcov at stack.nl
Sat Mar 19 16:17:06 CET 2011
In our previous episode, leledumbo said:
> > No, because overloading works the same as in C++ (determined statically at
> compile time).
> Are you sure, Jonas? Because I've been able to implement visitor pattern
> which is a kind of double dispatch. Of course it's not implemented like the
> example posted by the OP, but more like a simulation explained in
> http://en.wikipedia.org/wiki/Double_dispatch wikipedia .
That is purely statically typed based overloading as far as I can see, and
doesn't switch methods at runtime.
The only escape that I know to statically typed calling in FPC is IDispatch.
More information about the fpc-pascal