Re: scope of variables

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

I desagree with you on this. The rules of lexical scoping are so that you can define a variable of the same name inside narrower scope and this new variable will shadow the outer one.

integer a 
procedure foo() 
   integer a -- this is accepted and this new 'a' shadow the outer one. 
   ... 
end procedure 
-- the same should be true with this 
while 1 do 
  integer a -- this should be accepted and shadow the 'a' at top level. 
  ...  
end while 

look at others languages that implement scoping at block level (at think lua does) and you'll see that it is done as I says.

Jacques

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

Search



Quick Links

User menu

Not signed in.

Misc Menu