Re: New keyword added: continue

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jeremy Cowgar wrote:
> 
> 
> Why not
> 
> loop do
> ...
> again or repeat
> 

I wanted to prefix but forgot... There are common things we do in loops and
common ways of exiting a loop, thus we have for, while and until loops. If we get
too many loops, we just overly complicate things. If we have too little loops, we
overly complicate things as well. I do think the programming world has settled on
the three main loops that satisfy the vast majority of looping needs and they are
what we have, while, for and until. We probably do not need any more.

For instance, I learned yesterday or today, that 

while 1 do
...
end while

is optimized as:

begining:

   ... do something

goto begining

No exit checks or anything, so one could very well successfully argue we already
have the loop proposed by ken:

Loop

End Loop

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu