Re: namespace-nonproblem
- Posted by Daniel Berstein <daber at PAIR.COM> Apr 24, 1998
- 705 views
>> 2. The modified file will "break" most if not all previous programs >> written to include it. (Guaranteed to upset folks.) > >So have more than 1 copy. Huh? You're thinking as a single-user. >> 3. Sometimes names make sense. It is a shame to change >> them to something less intuitive, simply because you have >> already used that name for something else. >> > >Unless you're in the business of making libraries from other >libraries, identifiers are not important. At the end of the >day what matters is that your spreadsheet (or whatever >application) worked out your tax correctly and displayed it >in a warm and satisfying shade of pink. Same as above, lack of future vision. What if you develop a neat library that enables spreadsheet pop-up windows? Would you like to share it with others (comercially or not)? Even if that isn't the case, will you be in the mood of "patching" your code after several months? A more complex namespace mechanism is required by Euphoria, that's no doubt. How will it work is a matter Rob and Junko must resolve... and soon. A simple example: When I started coding my database engine I wanted to have separte libraries (.e) for diferent tasks (index, import, maintanance,...), so it would be easy to update, i.e, the indexing engine by simply replacing the proper file. My implementation relies on global variable for holding diferent workspaces. Is there currently a (simple) way of having all this modules access the same global variable(s), without getting into the "user" namespace? The answer is no. I just have options, tell the user to don't use some name-identifier my library uses, or have each function of my library passing each other an extra parameter with the desired information (more error-prone). Wouldn't it be useful we can declare a variable as global to a defined set of modules (currently your identifiers are either local or completly global)? Regards, Daniel Berstein.