Double Dispatch
John M McIntosh
johnmci at smalltalkconsulting.com
Thu Feb 12 14:13:21 UTC 2004
Just debug
3 + 4.0
and
4.0 + 3
and watch what happens after the primitive fails to deal with adding an
integer to a float.
Note how execution paths are different depending on what class of
number is on which side of the operator.
what is happening is that we are converting the number into the
required type, then re-dispatching the operation again.
On Feb 12, 2004, at 1:31 AM, Aaron Lanterman wrote:
>
> P.S. On another note, I've been reading about Double Dispatching for
> numeric conversions and have gotten terribly confused. I'll figure it
> out
> though...
>
--
========================================================================
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
========================================================================
===
More information about the Squeak-dev
mailing list
|