Re: Name-space proposal

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

jacques deschĂȘnes wrote:
> 
> 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
Situations like this is why namespaces were introduced in the first place. In 
this case, you *have* to use namespaces. Unfortunately, you have to use
namespaces for both variables, not just one or the other (which would be nice).

The problem lies when two third party libraries include the same symbol without
a namespace qualifier. Then you have to edit the libraries to fix it. That's why
libraries should definitely be using namespaces for subordinate includes.

I've got an idea that I want to try with the source, I'll get back to you on it.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare
j.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu