Re: routine_id() is not working
- Posted by useless_ Apr 11, 2013
- 1351 views
Please read up on euphoria namespaces. You don't put something into a namespace. You use a namespace to point at a particular file to disambiguate from a symbol in another file. You may declare a default namespace for a file as a convenience, but again, this isn't some sort of sandbox around the symbols in the file. It's just an easy way to tell euphoria to look at that particular file.
Matt
Ah, the last two sentences are the crux of my misunderstanding. They should be in the manual, at the very top of the namespace section.
However, loading two procedures or function by the same name (and un-namespaced) being legal, but loading variables of the same name (and un-namespaced) isn't, seems wrong, because if the programmer didn't namespace them (include blah.e as blah), one or more of them cannot be used.
I don't read all of win32lib.e or it's many includes, so i might write a procedure of the same name as exists in win32lib. Or perhaps something under std/net (which has happened a few times the last few years). I doubt anyone reads all the proc names in every file they might include to see if that name is already taken.
For that reason, i suggest Euphoria "understand" transparently and automagically that all procedures and functions in includes are now addressable like filename:procname, if the programmer has not manually done so. And if i then include os.e and misc.e and then want to use sleep(), being that it's in two files and i didn't specify which one to use, Euphoria toss an error before it runs, letting me know to choose one.
useless