Re: scope of variables

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

Why do you want to change a rule that is accepted in all languages: >>One can redeclare a variable inside a function and shadow an outer one.<<

BTW, how does one refer to the encompassing var that has been shadowed in other languages?

I guess you know the answer: in PASCAL ( and DELPHI) one use the unit namespace as in euphoria :) . But in pascal and any language I knows about, variables that are declared inside functions have precedence over the ones in outer scopes with same name. It is how euphoria works too and I hope it will stay that way. If it had to be changed I will regret that I started this thread.

I must be able to reuse a name that was used at an outer scope.

Jacques

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

Search



Quick Links

User menu

Not signed in.

Misc Menu