Re: scope of variables

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

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. 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.

Various languages do this. Euphoria is not one of them. Maybe it should be brought up for discussion as to make it do this in a future version but as of 4.0 this is not a bug, it is its design. I personally feel that shadowing variables is a bad idea and shouldn't be used in code.

To start the dialog, in what situation would it be beneficial to allow duplicate variable names of various types?

Jeremy

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

Search



Quick Links

User menu

Not signed in.

Misc Menu