Re: Name-space proposal
- Posted by jacques deschênes <desja at globetro?te?.net> Aug 03, 2007
- 493 views
Hi Robert, I tested it and that is true. I confounded that situation with this one: --test.e global constant test=123 --test2.e global constant test=345 --main.ex include test.e include test2.e ? test which result in this: C:\Temp\main.ex:3 A namespace qualifier is needed to resolve test. test is defined as a global symbol in: c:\temp\test.e c:\temp\test2.e regards, Jacques Deschênes Robert Craig wrote: > > jacques deschênes wrote: > > this is a reasonable proposal, I back it. What is in the main file of a > > program > > should have priority than what is in include in case of redefinition. > > That's how it *does* work. > > If a symbol is defined in the same file > where the reference to it occurs, > that symbol will be used, regardless of what > is defined in other included files. It has been that > way ever since 2.3 when the namespace feature > was first introduced. > > Bernie must be using version 2.2 or earlier, > where namespaces didn't even exist. > > > Bernie Ryan wrote: > > > > > > Anybody: > > > > > > If name-space worked in this way it would solve a lot of problems. > > > > > > If a program contains a function foo()in the local main file and another > > > > > > file is included containing a foo() function. The interpeter would not > > > > > > stop but continue using the foo() function in the local main file. > > > > > > When the program ends; the program would issue a warning that there > > > > > > is a duplicate function foo() exists in include file xxx.e just > > > > > > as it lists unused constants etc. > > > > > > This would eliminate breaking code and allow debugging. > > > > > > There could also be a special flag Example: with_out_name_space > > > > > > to turn this on/off > > > > > > Bernie > > Regards, > Rob Craig > Rapid Deployment Software > <a href="http://www.RapidEuphoria.com">http://www.RapidEuphoria.com</a>