From: wtanksle at dolphin.openprojects.net (William Tanksley)
Date: Sat, 15 May 1999 19:54:38 GMT
Subject: python hack of the day -- "listable" functions
References: <jlaev9ooh1.fsf@arathorn.bbb.caltech.edu> <373c22bf.6287591@news.omnilink.de> <slrn7jmcn3.nmo.wtanksle@dolphin.openprojects.net> <373e4c42.16914501@news.omnilink.de> <slrn7jp0m8.qhs.wtanksle@dolphin.openprojects.net> <7hi1bb$4ne$1@holly.prod.itd.earthlink.net> <373DB6F4.3E64A8A2@home.com>
Message-ID: <slrn7jrk7u.t5q.wtanksle@dolphin.openprojects.net>
Content-Length: 1822
X-UID: 1712                                               

On Sat, 15 May 1999 18:01:10 GMT, Jim Meier wrote:
>William Tanksley 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.

>I think grammar-oriented languages are a very, very interesting idea. I saw a
>posting somewhere(freshmeat.net?) about a language whose modules were allowed
>to define and maybe redefine syntax. struck me as neat, but to wrap it together
>and call it "grammar".. could we "conjugate" verbs for different effect?? wow..

Conjugation isn't an aspect of grammar in general.  It's only part of
certain languages.  Lojban isn't conjugated at all (but then Lojban is an
artificial language).

>> 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.

>How is it different from normal polymorhpism?

It's different because normal polymorphism dispatches to only one object.
This would be dispatching to several.

>The language (if it cares) would
>dispatch to the member function whose signature matched the parameters. This is
>normal in many OO languages (C++ being the first to come to mind)

This is called "overloading", not polymorphism.  As a matter of fact,
overloading makes OO _very_ difficult, and makes it easy to make bad
mistakes which the compiler and runtime can't catch.

Overloading looks like multiple dispatch but isn't, just like static
binding looks like OO but isn't.

>-Jim.

-- 
-William "Billy" Tanksley
"But you shall not escape my iambics."
           -- Gaius Valerius Catullus




