[Python-3000] Stackable Blocks

Crutcher Dunnavant crutcher at gmail.com
Fri Apr 28 04:09:26 CEST 2006


On 4/27/06, Georg Brandl <g.brandl at gmx.net> wrote:
> Crutcher Dunnavant wrote:
> > Having been shot down so hard on my request to bring for loops into
> > symetry with list comprehensions, I have a new proposal - stackable
> > blocks.
> >
> > This is a very _small_ amount of syntax sugar, the basic idea is that
> > any block headers can be stacked on the same line. This changes no
> > semantics, nor does it change ordering, or add new keywords, it just
> > changes a tiny bit of the grammar for whitespace/block parsing.
> >
> > So for instance this:
> >
> > for file in open_files:
> >   if file.readable():
> >     ...
> >
> > can be spelled like this.
> >
> > for file in open_files: if file.readable():
> >   ...
>
> Gak. I think it was a Freudian anti-slip that you used "readable" in the
> above example ;)

Ha. ha-ha. No.

> Also, you know that Guido at one time said he wanted to forbid the
> "if x: y" suite style?

I don't really care. What I really want is to be able to say:

CONTEXTUAL-TRAVERSAL-SPEC:
  TRAVERSAL CODE

I don't really care how it gets spelled. In the current system, I
_have_ to break the context spec up on multiple lines, _despite_ the
fact that we have list comprehension semantics. I'd like to see a
solution. This one seems much simpler than the list comprehension
semantic loops I proposed earlier, so I thought it would recieve some
sympathy. Aparently it doesn't, which kinda bums me.

--
Crutcher Dunnavant <crutcher at gmail.com>
littlelanguages.com
monket.samedi-studios.com


More information about the Python-3000 mailing list