1. Can public/export be made to override global?
- Posted by ArthurCrump Nov 28, 2009
- 969 views
When developing new libraries while still using old libraries it is inconveient for global identifiers in old modules to conflict with the public or exported identifiers in old modules, because the global identifiers are too pervasive. It would be more convenient if the newer identifers could hide the old ones automatically. I am not putting a ticket in for this as a feature because other users may not agree with me.
Section 4.2.3.5 of the manual would be altered from: { global/public/export file routine block 1 block 2 ... block n to: {{{ global public/export file routine block 1 block 2 ... block n
2. Re: Can public/export be made to override global?
- Posted by mattlewis (admin) Nov 30, 2009
- 923 views
When developing new libraries while still using old libraries it is inconveient for global identifiers in old modules to conflict with the public or exported identifiers in old modules, because the global identifiers are too pervasive. It would be more convenient if the newer identifers could hide the old ones automatically. I am not putting a ticket in for this as a feature because other users may not agree with me.
I believe there is already a workaround for the situation that you describe:
with/without indirect_includes
Using this feature allows you to more easily use older code that may use, for instance, the 3.1 standard library. Essentially, it creates a "firewall" that prevents global symbols not directly included from being used.
Basically, put a without indirect_includes directive around the include statement for the older library, and your code should work correctly. Of course, if that library is a multi-file library like win32lib, you may need to include additional files in order to access globally scoped symbols in those files.
Matt
3. Re: Can public/export be made to override global?
- Posted by ArthurCrump Nov 30, 2009
- 810 views
Thank you. I had not noticed that option. It solves the problem without needing to override globals automatically.
Incidentally, this thread was submitted twice, accidentally, before it was complete. This thread was not updated; the other thread with the same title was updated and has also received a reply.