Re: Conflict add_item
- Posted by jimcbrown (admin) Mar 08, 2015
- 1631 views
However, I only use sequence.e for other reasons, and don't use the add_item of sequence.e so for me the best solution is to keep wxeud.e unchanged, and comment out the add_item in sequence.e
The namespace system is designed to allow programmers to solve these issues without having to edit third party libraries. For the purpose here, it's not important what any particular programmer does. The recommended way of doing things is to add namespace qualifiers in your code when you run into this sort of problem.
Editing the libraries like that is going to cause you problems.
Well, I can see it from the OP's POV. Having used add_item() from wxEuphoria in hundreded or thousands of places in a very large file, then suddenly needing to include std/sequence.e for one function call that's only used in one place, resulting in the need to manually edit hundreds or thousands of lines of text (just to ad the "wx:" bit) is annoying. A modern text editor should have no problems changing all such references at once - but editing std/sequence.e directly results in fewer lines to audit I suppose.
Perhaps we need a way to say "if a namespace conflict exists, instead of throwing an error to warn the programmer, just default to using this namespace and require all calls to the other namespace in this file to be explicitly qualified" or something.