python hack of the day -- "listable" functions

Charles Hixson charleshixson at earthling.net
Fri May 14 16:33:36 EDT 1999


William Tanksley wrote in message ...
>On Thu, 13 May 1999 22:50:34 GMT, Stefan Franke wrote:
>>On Thu, 13 May 1999 20:15:32 GMT, wtanksle at dolphin.openprojects.net
(William
>>Tanksley) wrote:
>
>>>On Thu, 13 May 1999 19:50:35 GMT, Stefan Franke wrote:
>
...
>Now, consider this.
>
>x = o.verb(a,b,c)
>
>You've created a language feature where the action of the verb depends not
>on the single object it's attached to, but on EACH of the parts of speech
>in its parameter list.
>
>After that change, Python wouldn't be object oriented.  It'd be grammar
>oriented.
>
>Let that one sink in for a while.
>
>Ouch.  Has anyone done work on how to do that?  It's polymorphism, but
>with the action depending on every parameter rather than just one.
...
I think that Common Lisp inheritance works like that.  Perhaps Dylan also,
but if I remember correctly the Common Lisp version had this feature in a
"more essential" form.  Truthfully, this might just have been a feature of
Franz' Allegro Common Lisp, but I don't think so.







More information about the Python-list mailing list