Re: A Problem with v2.4 (for Rob)
- Posted by Derek Parnell <ddparnell at bigpond.com> May 20, 2003
- 418 views
----- Original Message ----- From: <irvm at ellijay.com> To: "EUforum" <EUforum at topica.com> Subject: Re: A Problem with v2.4 (for Rob) > > > On Monday 19 May 2003 10:41 pm, Derek wrote: > > > If we are using the current Euphoria then either the coder that is > > combining libraries will have to do some changes to the library code, or > > get the original authors to change their libraries. > > Which was, I thought, what we were trying to avoid. I assume you mean by this is that the rationale for namespaces was that we are trying to avoid the need to alter other people's code. > Changing someone else's libraries is error-prone and counter-productive. > Plus you now have to ship those modified libraries along with your program, > causing conflicts with other programs which may use the original unmodified > libraries. > Then whenever the original author of the library changes/updates her code, > your program no longer works. Some solution! Agreed. And that's why we are trying to avoid being forced to modify their code. > Add to that the fact that properly implemented namespacing could encourage > clearer, more modular coding, but the current solution fails to do this, > because you can't "pass on" namespaced variables via another include. Its only in the last few days that I've realized I've been thinking about Euphoria's namespace implementation the wrong way round. I too thought like you that a coder put in namespaces for others to use when needed. This is the idea of "passing on" namespaced identifiers. However, I now see namespaces as just a way for me to force Euphoria to use a specific global symbol rather than one that just happens to be in scope. But it only effects the code that I write. In other words, if I'm writing a file that *could* be included by somebody, I really should ensure that any global symbols I use that are contained in files that I include, then I should be prefixing them with a namespace qualifier. That way, Eu is forced to use the global(s) from the specific files I include and not get confused with the same name being defined in some file that I did not explicitly include. To summarize, "X:Y" tells Euphoria to ONLY look in the file I've given the namespace 'X', for the symbol 'Y' - and not to bother looking anywhere else. > I'm sorry, but I have tried very hard to find a practical use for namespacing > (as implemented) and I just can't. Even though currently its not perfect, its still better than nothing - just. ---------------- cheers, Derek Parnell