do ... while loop

Gordon McMillan gmcm at hypernet.com
Wed Oct 13 23:10:14 EDT 1999


Joshua Marcus writes:

[do..while]

> "Syntactic sugar" isn't a slur; while we don't theoretically need
> "syntactic sugar", the sweet-stuff makes code easier to read. 
> I'm only trying to agitate for the the third of the three C loops
> here, not trying to open up the floodgates in the face of
> puritanism.

If Python were Puritan, you wouldn't have for loops. Any loop 
can be coded as

while 1:
  <block 1>
  if <condition>
    break
  <block 2>

The fact that "for" exists and "while" takes a condition (and 
both take an "else" clause) is symptomatic of the 
insidious Dutch tendency to permissiveness.

no-one-under-18-should-ever-see-a-"continue"-ly y'rs


- Gordon




More information about the Python-list mailing list