why no "do : until"?

D-Man dsh8290 at rit.edu
Thu Jan 11 20:09:08 EST 2001


On Fri, Jan 12, 2001 at 12:33:58AM +0000, Robert Amesz wrote:
[snip]
| 
| Well, to put in my fl 0,02 (soon te be about E 0,01 <g>) I have to say 
| I feel that syntax is flawed: not only does it break the block in two 
| parts (whereas a dedent in other cases means the end of the block is 
| reached), but it's also visually ambiguous because a 'while' could be 
| the start of a loop, but it might also be somewhere in the middle of 
| one.
| 
| As I prefer programming languages to be as context-free as possible, 
| I'd like to make a counter-proposal:
| 
|      do:
|           something
|           until condition
|           something else
| 

This also breaks the indent-denotes-block-structure style.  Is the
"until" clause really a part of the "something" block?  If it is
adopted I think it ought to stand out more tying it more closely to
the "do".  I wouldn't mind if, say, the until was to recieve a
half-indent (or half-dedent depending on your view) as compared to the
"something" and "something else" blocks.

| 
[snip]
| All syntactic sugar, I admit, but so was the other proposal. However, 
| this proposal would have a lot less impact on the overall syntax of 
| Python, which would seem to be more in keeping with its modest goals.
| 

I wouldn't really mind Alex's version of Knuth's construct either, with
the same indentation consideration.

-D





More information about the Python-list mailing list