Re: rant // OE scope \\ forked out of 500 Rosetta
- Posted by petelomax Mar 21, 2017
- 2167 views
which explains why there are thousands of programming languages.
Another explanation might be that most of them are rubbish! (especially the famous ones?)
Is there a good reason for having separate scopes for each branch?
It reduces the area of code that you have to scan in order to decide whether a variable has already been declared.
I cannot think of any advantages to scopes across branches, when moving the declaration just above the opening if is what I might call "close enough".
Having trouble decoding this.
- ? N-OO
"several hundred".
- ? example shows if you mention "routine"
You lost me there
Is your example suggesting you want to create a global w or a global W from an if branch?
Not at all. I should really have said:
The expense of modifying a compiler to support local scopes cannot be justified if all your routines are small enough to fit on one screen.
I was not suggesting removing any features from OpenEuphoria or Phix, but rather accepting the decision not to add them to Orac.
Pete