[Python-Dev] anonymous blocks

2005-04-19 Thread Shannon -jj Behrens
(I apologize that this is my first post. Please don't flame me into oblivion or think I'm a quack!) Have you guys considered the following syntax for anonymous blocks? I think it's possible to parse given Python's existing syntax: items.doFoo( def (a, b) { return a + b

Re: [Python-Dev] anonymous blocks

2005-04-19 Thread Shannon -jj Behrens
I apologize for sparking such debate on this list instead of on c.l.py. By the way, the only reason I brought this up was as a replacement for lambdas in Py3K. Guido, in response to your much earlier comment about supporting "{}" for normal defs as a matter of consistency within my proposal, yes,

Re: [Python-Dev] Re: anonymous blocks (off topic: match)

2005-04-20 Thread Shannon -jj Behrens
> PS. a side effect of the for-in pattern is that I'm beginning to feel that > Python > might need a nice "switch" statement based on dictionary lookups, so I can > replace multiple callbacks with a single loop body, without writing too many > if/elif clauses. That's funny. I keep wondering if "

Re: [Python-Dev] Re: switch statement

2005-04-20 Thread Shannon -jj Behrens
On 4/20/05, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > Fredrik Lundh wrote: > > PS. a side effect of the for-in pattern is that I'm beginning to feel > > that Python > > might need a nice "switch" statement based on dictionary lookups, so I can > > replace multiple callbacks with a single loop body

Re: [Python-Dev] Re: switch statement

2005-04-21 Thread Shannon -jj Behrens
On 4/21/05, Michael Hudson <[EMAIL PROTECTED]> wrote: > Shannon -jj Behrens <[EMAIL PROTECTED]> writes: > > > On 4/20/05, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > > > >> My use case for switch is that of a parser switching on tokens. > >> &g

Re: [Python-Dev] Re: switch statement

2005-04-25 Thread Shannon -jj Behrens
On 4/25/05, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > Shannon -jj Behrens wrote: > > On 4/20/05, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > > > >>Fredrik Lundh wrote: > >> > >>>PS. a side effect of the for-in pattern is that I'm beg