What makes code "readable"? (was Re: Python vs. Perl, which is better to learn?)

Christopher Barber cbarber at curl.com
Wed May 8 17:45:42 EDT 2002


ajeru at vknn.org (Alexander Jerusalem) writes:

> What OO does is to make one (the first) parameter special. The class
> of that parameter will be searched to find the method that should
> actually be called. The first parameter isn't passed in as all the
> other parameters.

To be fair, that is only one particular flavor of OO.  In Dylan and several
other languages, method selection is based on the dynamic type of all of the
arguments, not just the first.  This type of dispatch is often called
"multimethods" or "generic functions".  It is hard to do this type of
dispatching efficiently but there has been some interesting research in this
area.

I personally have mixed feelings about this type of dispatch, but it
definitely makes sense for operator overloading.

- Christopher



More information about the Python-list mailing list