Re: loop do .. until end loop is surely incorrect!

new topic     » goto parent     » topic index » view thread      » older message » newer message
bill said...
while TRUE with entry do   
  integer x = 3   
entry   
  ? x   
end while  

Your comments about how it is an error is fine if you reduce everything to jumps and labels.

Of course the code is incorrect.

But my point is that it is incorrect not because it reduces to use before declaration but because at the higher level it is a jump into scope.

The scope inside of the loop is a red herring here. I get that you're uncomfortable with the way the scopes are set out, but you should be able to see that the issue is the jump. Consider this equivalent code:

integer x 
while TRUE with entry do   
  x = 3   
entry   
  ? x   
end while  

Same problem, but x isn't scoped inside the loop.

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu