Discussion: new operators for numerical computation
Edward Jason Riedy
ejr at lotus.CS.Berkeley.EDU
Sun Jul 23 13:30:37 EDT 2000
And Paul Prescod writes:
-
- Neel, I think you have projected your own wishes onto that of the
- matrix people!
Perhaps, but a common complaint I hear about any language is
``the lack of general overloading.'' After translation into
programming linguistic speak, that translates into multiple
dispatch.
It's hard to implement methods that work across and between
members of the number hierarchy without it. You invariably
end up with something nasty like the `bridge' pattern or
explicit type checks (``layered visitors'' or some such name).
At that point, your code becomes less about the numerics and
more about the little nooks and crannies of a given language.
That's bad, imho.
What's worse, some of us want to dispatch on the _returned_
type, too. Really helps you pick the right precision in which
you calculate intermediate results, but it feels semantically
messy. Haven't put enough thought into that one yet. It
could be solvable just with type inferencing within expressions.
But this is comp.lang.python, not comp.lang.dylan. I still
can't help but feel that Dylan is to Python as Smalltalk is to
Java.
Jason
More information about the Python-list
mailing list