Re: problems with the scoping in eu4
- Posted by jaygade Jan 07, 2011
- 1964 views
Not being able to declare a variable in a nested scope of the same name as a variable in outer scope is odd. Being able to declare a parameter of the same name as the outer variable (and for that to operate exactly as one would expect - temporarily shadowing the outer variable) makes things rather more odd.
I agree with this, and there is another thread discussing it.
None of the problems I have mentioned are show stoppers. I think they add complexity and particularity. Other than that well it is certainly programmable and rather elegant.
I guess the problem is elegant designs are often hard to improve.
I dislike while with entry and I think that variable declaration should be prohibited in while and switch, and that Eu should have a clean block scope notation.
I didn't used to like "with entry", but seeing it used it's utility is pretty clear to me. I don't think that it adds complications.
While I do believe that some clutter has been added to Euphoria, overall the dev team has done a pretty good job. Heck, when Rob initially designed the language he supposedly didn't include a "for" construct because the "while" loop could handle all cases. Without labels or "with entry"