Object orientation - can you have too much of a good thing?

Lukas Renggli renggli at gmail.com
Sun Oct 28 19:24:18 UTC 2007


> Well, it is a long winded way of saying "yes, multimethod dispatch is
> nice".  But as he points out, the same thing can be done with
> double-dispatch (visitor pattern etc.), which is what multimethod has
> to do anyway, at runtime.  But having multimethod is less typing and
> more concise, which is worth something.  I personally can't think of
> any concise way to add it to Smalltalk.

I did something like that a long time ago. I called it 'Functional
Pattern Matching' as I just attended a course about Haskell at that
time. In fact it is an implementation of multi-methods:

     http://renggli.freezope.org/programming/smalltalk/fpm

The documentation is a bit misleading. All the matching presented can
also be done on the arguments. The code itself probably doesn't work
with recent images anymore. Try with Squeak 3.6 or 3.7.

Cheers,
Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch



More information about the Squeak-dev mailing list