Re: Phix loop variables and scope

new topic     » goto parent     » topic index » view thread      » older message » newer message
_tom said...

looks like this "namespace" idea is incomplete.

They do what they were intended for, perfectly well, at least in my book.
[EDIT: Actually, some people do tend to abuse them, and fair point, they don't always withstand mistreatment too well...]

_tom said...

What do you mean by "pre-declaring" ? (I only understand examples.)

pre-declared:

integer x=0   
for x=2 to 7 do 
end for 
?x -- valid 

not pre-declared:

for y=2 to 7 do   
end for 
--?y -- invalid 

both (should) work equally, except as shown x can be referenced after the end for but y cannot.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu