2001 Enchancement Wishlist
Aahz Maruch
aahz at panix.com
Sun Dec 31 11:05:12 EST 2000
In article <mailman.978265218.29152.python-list at python.org>,
Tim Peters <tim.one at home.com> wrote:
>
>I suggest you're off track in your modeling, confounding roles that should
>be distinct: that of Plus as a function and Plus as an object (representing
>an only partially evaluated sum). In this case I'd probably have a base
>class Expression for all kinds of expresssions (incl. atoms like Symbols),
>make Plus a function mapping zero or more Expressions (or subclasses) to an
>Expression (or subclass), and make Sum a subclass of Expression that
>represents a partially evaluated sum. That's the way I *think* of the
>domain, so that's the way I'd want to code it (and, no, I'm not bothered by
>having to come up with distinct names for the verb sense (Plus) and the noun
>sense (Sum) -- the distinction between nouns and verbs is usually helpful!).
Actually, to nitpick a bit, I'd suggest "Add" as the verb.
--
--- Aahz (Copyright 2000 by aahz at pobox.com)
Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6
Ninth Virtual Anniversary: Tomorrow!
More information about the Python-list
mailing list