Re: Lambda binding solved?

Steven D. Majewski (sdm7g@elvis.med.virginia.edu)
Fri, 25 Feb 1994 10:52:22 -0500

On Feb 25, 15:01, Guido.van.Rossum@cwi.nl wrote:
> Subject: Re: Lambda binding solved?
>
> I don't think Steven proposed this as a serious solution... But I
> can't help pointing out some flaws.
>

Correct. Having proposed the "frowing Guido" diglyph ":(" as a
block delimiter, I figured I has used up my quota of smileys.
It wasn't a serious attempt at THE solution, but a demonstration.

>
> A safer approach would be to have a new built-in function bind() which
> takes a function object and a dictionary as arguments and returns a
> *new* function object which is the binding of the old function's code
> object with the given dictionary. (This also keeps the idea of
> functions as immutable objects, which I like.)
>

Which is exactly what I thought I was demonstrating the need for.
( But it's always easier to prototype a solution in Python before
hacking at the interpreter. I just had to take out one more
READONLY from the previous change to add documentation objects. )

> [ some discussion of nested scopes edited. ]
>
> Personally, I'd hate to see a Python programming style develop where
> people code their entire program as a set of nested functions, a la
> Pascal -- I'd much rather encourage people to use a more
> object-oriented style instead based upon multiple modules instead.
>

Although I also proposed nested scopes with LET, I share some of your
concerns.

>
> PS It don't think the argument exists that will convince *me* that
> Python needs explicit open/close brackets, even optional ones. So
> you're all wasting your breath on that one :-)
>

No "frowning Guido" ?

;-(

- Steve Majewski (804-982-0831) <sdm7g@Virginia.EDU>
- UVA Department of Molecular Physiology and Biological Physics