Re: loop do .. until end loop is surely incorrect!
- Posted by mattlewis (admin) Feb 26, 2011
- 1744 views
bill said...
It seems to me that the biggest problem with declaration in loops is not the syntax but declaration combined with with entry (or goto).
Essentially, with entry makes any talk of scope pointless as the entry label can be anywhere in the loop.
As Derek said, a smarter parser would find this to be an error, just like:
integer x if foo() then x = 1 end if ? x
For instance, Java tends to see this and flag it as an error. This sort of thing is very useful, but not simple to do, especially in more complicated situations. I agree that the with entry construct can be dangerous, but then, as I just showed, so can if-then. Both have their usefulness, however.
Matt