Discussion: new operators for numerical computation

Neel Krishnaswami neelk at brick.cswv.com
Sun Jul 23 10:20:01 EDT 2000


Neil Hodgson <neilh at scintilla.org> wrote:
> > I first ran into this when I tried to implement a sparse matrix
> > class. At that time, the Numpy distribution had a Matrix class that
> > implemented regular matrix multiplication with '*', and I wanted to
> > write another class SparseMatrix that would do the right thing
> > whenever it was multiplied with a Matrix.
> 
>    I had a look at Dylan a few years ago and multimethods look good for some
> areas but you also lose the encapsulating aspect of normal OO. The
> functionality for a class isn't nicely tied up in one bundle but is
> federated over a wide and extensible area. I would expect Python with
> multimethods to look very different from current Python. Like Aahz, I'd like
> to see what your idea of Python with multimethods would look like?

Honestly, I don't have a good idea yet. I'll spend a couple of days
trying out some variations and then get back to you.

In the meantime, there's a simple-minded implementation you can use to
play around with multimethods on my webpage

  http://www.sff.net/people/neelk/open-source/Multimethod.py

It's a one-day hack, so be warned -- it's more for experimentation than
anything else.

And there's a technical report by some of the Tuple and Cecil people
that implements a module-friendly multimethod system for Java at

  ftp://ftp.cs.iastate.edu/pub/techreports/TR00-06/TR.ps.gz


Neel



More information about the Python-list mailing list