#1038 Enhanced While Loop

Akcelisto Thu 25 Mar 2010

"Enhanced While Loop" may be useful for Fantom.

http://www.python.org/dev/peps/pep-0315/

do{
  <setup code>
}while(<condition>){
  <loop body>
}

Instead of usual code duplication:

<setup code>
while(<condition>){
  <loop body>
  <setup code>
}

andy Thu 25 Mar 2010

Might be useful - will have to take a look at how often that comes up for me.

tactics Thu 25 Mar 2010

I'm not one for variations on a loop. And especially not this early in the game.

At the least, I'd rather use a better name. Do-while has old connotations from C. Furthermore, with two statement bodies, it's not clear to people unfamiliar with the language what the semantics are.

Login or Signup to reply.