Origin of the term "first-class object"

Bengt Richter bokr at oz.net
Tue Nov 25 21:28:09 CET 2003


On Tue, 25 Nov 2003 15:07:22 +1300, "Greg Ewing (using news.cis.dfn.de)" <g2h5dqi002 at sneakemail.com> wrote:

>Jp Calderone wrote:
>
>>   Up for a new operator?
>> 
>>     l[index] ()= f
>
>I like it! :-)
>
Me too ;-)
But I wonder if =()= wouldn't read more clearly, e.g.,

    l[index] =()= f

and see below.

>I suppose you should be able to put extra args in, too, e.g.
>
>   l[index] (foo, 42)= f
>
I presume that would imply that f had all optional args after the first.
What if you wanted to pass the update target in another position? E.g.,

    l[index] =(foo, ??, 42)= f

where ?? is some kind of indicator for where to plug in the arg. I guess you
could use packing/unpacking if you had a tuple left side and several ??'s to match, e.g.,

    a, l[index] =(foo, ??, 42, ??)= f

meaning

    a, l[index] = f(foo, a, 42, l[index])

or course the targets could be simple as well

    a, b =(foo, ??, ??, 42)= f

meaning

    a, b = f(foo, a, b, 42)

Hm, I wonder about * for pack/unpack into arg tuple in this context
    
    a, b =(foo, *??, 42)= f

maybe meaning

    a, b = f(foo, (a,b), 42)

or did I get that backwards?

Sorry, can't help it ;-)

Regards,
Bengt Richter




More information about the Python-list mailing list