RE: My not-quite obsolete namespace parser
- Posted by irv at take.maxleft.com May 16, 2002
- 387 views
Derek Parnell wrote: > Hi Irv, > don't get me wrong - I'm with you on this one. RDS has got it wrong. RDS > > was so concerned to get around the problem one has in C with duplicated > definitions that it also removed a perfectly valid use of same-named > files. Exactly. And if someone *did* include the same file twice, what's the harm? Suppose that foo.e is a copy of bar.e. With ver. 2.3, you can include both without *any* warnings or problems. You can even have global variables with the same name in each, but with different types, still no problems. Only when you try to reference a global from your main program does Euphoria give an error - 'a namespace qualifier is needed to resolve' the variable or function being referenced. IOW, it's asking "Which x are you talking about here?" Since you are writing the program which uses those two files, you are fully able to answer that question, and so where's the harm? There's not any. It would be nice if Euphoria was a bit more helpful, for example, the error message read: "global integer x in foo.e" "global sequence x in bar.e" "please qualify one or both include files" That would be *much* better than just quietly 'forgetting' an entire file just because it happens to have the same base name as another file.