while true: !!!

Steve Lamb grey at despair.rpglink.com
Sat Dec 16 11:45:07 EST 2000


On 16 Dec 2000 10:34:06 GMT, Remco Gerlich <scarblac at pino.selwerd.nl> wrote:
>Yes! And you don't need the ugly "break" statement, you can simply do
>"true = 0" and the loop will end! (Remember to set it back to 1 later)

    Am I the only one who doesn't think that "break" is no more ugly than
"continue"?  They are flow control, nothing more, nothing less, and a natural
part of the language.  I certainly find the former more pleasing than the
latter because it is how things should be

while 1:
  if false:
    break
  do something

true = 1
while true:
  if false:
    true = 0
  else
    do something

    But, hey, that might just be my perlism showing through since even though
I dislike constructs like "next if (true)" because I've had to rewrite too
many "next if ()"'s to "if () {next}" so I could put in other operations.  IE,
there was a practical reason other than someone's notion of asthetics
dictating the form and function.

-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
         ICQ: 5107343          | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------



More information about the Python-list mailing list