in reply to Overloading different instances differently.
Seems like overkill. Overloading is just a special syntax for a behind the scenes method call. Just make your method call implementing the overload examine the instance its called on and vary what it does accordingly instead.
Simplest implementation that comes to mind is have the name of the overload method you really want called on the method stored in the instance. If that's too constraining you could also store a coderef for the behavior instead and have the overload method just call that.
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Overloading different instances differently.
by tilly (Archbishop) on Feb 22, 2008 at 22:18 UTC | |
by Fletch (Bishop) on Feb 22, 2008 at 22:54 UTC |