Let's Talk About Lambda Functions!

Steve Holden sholden at holdenweb.com
Sun Aug 4 17:17:35 CEST 2002


"John Roth" <johnroth at ameritech.net> wrote ...
> "Steve Holden" <sholden at holdenweb.com> wrote ...
[ ... ]
> > Mostly because anything as complicated as this current proposal is
> more
> > complicated than defining a named function and using it the once.
> Frankly
> > (IMHO), anything that need this much explanation is unlikely to find
> its way
> > into Python.
>
> Taking account of Tim Peter's comments on 7/29, I think you're
> right that Guido is unlikely to approve it. Nontheless, it's been an
> interesting conversation to get my head straight on how it should
> look in Python, if it was ever approved.
>
I'm glad it's been helpful.

> And at this point, it's incredibly simple, not complicated. When the
> compiler sees the token sequence: 'left paren,' 'indent,' 'def' it
> shifts to compiling an anonymous function, including the indentation
> rules. When the function ends, it shifts back to whatever it was
> doing before. I fail to see what is complicated about that.
>
...if we overlook the minor detail that the "indent" token can only occur at
the beginning of a line. I don't mean to beat this to death, but in order
for your proposal to work you have to alter the syntax of expressions to
make indentation significant where it currently isn't. That's a) far from
trivial, and b) far from obvious.

> The actual implementation needs to take care of those messy details
> of real world syntax, but it's still not complicated.
>
You believe. I'm still wondering how you can measure the indentation level
of a token that isn't the first non-whitespace token on its line, and how
you can verify that subsequent lines have "the same" indentation.

There's probably some detail of your proposal that I'm missing, but I really
do believe it's dead in the water. You could produce a PEP, that at least
would have the merit of making your proposal (and the reasons for its
rejection, should it be rejected) fully explicit.

regards
-----------------------------------------------------------------------
Steve Holden                                 http://www.holdenweb.com/
Python Web Programming                http://pydish.holdenweb.com/pwp/
-----------------------------------------------------------------------








More information about the Python-list mailing list