>       Double dispatching in Smalltalk model, as I understand it,
>       goes like this (using Haskell keywords for integers):
> 
>       Int, being a more primitive type, does not have to know how to
>       cope with Integer in the situations like this: Int * Integer.
>       So the method (*) in Int class has a hook for mixed arithmetic
>       with any, not necesserily Integer, object - it just dispatches
>       this expression again, after it sees that the other object is not
>       Int - but this time as "Integer * Int".

!!!  Surely after the recent discussion re numerical algorithms and a
new class structure for the algebraic hierarchy we all know that this
is no good.  The binary operations (*), (+) etc are not commutative on
all types, notably Float.  But the idea is sound, as long as you have
both a left and a right multiplication as class methods.

--KW 8-)
-- 
: Keith Wansbrough, MSc, BSc(Hons) (Auckland) -------------------------:
: PhD Student, Computing Science, University of Glasgow, Scotland.     :
: Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.     :
: http://www.dcs.gla.ac.uk/~keithw/  mailto:[EMAIL PROTECTED]       :
:----------------------------------------------------------------------:


Reply via email to