Re: Let's talk about scope
- Posted by Daniel Berstein <daber at PAIR.COM> Jan 18, 1999
- 467 views
At 11:44 p.m. 17-01-99 -0500, you wrote: >Ralf's suggestion was to change the scope rule to allow routines in deep >includes inaccessible. This would solve my problem, but create others. I >think I have included graphics.e file. I know it includes machine.e. So, >in my main file, I call machine.e files without directly including it. I >am exploiting the scope rules. If this new scope rules is implemented, all >such programs would no longer work. But you can fix it with a simple include xxx.e If you follow the library reference there says wich include file contains a particular routine.Following that guideline there should be NO side effects. I totally agree that a more complete namespace mechanism should be implemented. I particulary like Turbo/Object Pascal unit aproach. Just name each include file, if there is an identifier conflict you can specify the include file you actually mean to address. Example: include myfile.e integer x x = myfile.x + 10 -- x is declared in myinclude.e as global or include myfile.e integer x x = (x in myfile) + 10 About prohibiting nested include files a solution would be: include this.e -- Can't get accessed out of this module global include that.e -- Can get accessed out of this module Regards, Daniel Berstein daber at pair.com