1. Can public/export be made to override global?
- Posted by ArthurCrump Nov 28, 2009
- 1007 views
(Sorry, pressed the wrong key and sent it accidentally before it was complete.)
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, even if it were possible.
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
This should not have any effect on programs which are already working.
2. Re: Can public/export be made to override global?
- Posted by jimcbrown (admin) Nov 28, 2009
- 1064 views
This should not have any effect on programs which are already working.
Agreed, as those are usually either all old code using global only, or all new code using public/export only.
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, even if it were possible.
This I feel is a bad idea in general, as you could end up using the wrong identifier by accident with no warning or error from the system.
The correct way to deal with this is to use the namespace system to separate the two sets of include files, but doing this with globals has always been somewhat unwieldy at best. I'm not sure what the best thing to do here is.
3. Re: Can public/export be made to override global?
- Posted by ArthurCrump Nov 30, 2009
- 892 views
This thread was submitted twice, accidentally, before it was complete. This thread was edited but not the other one.
On the other thread MattLewis has pointed to an existing method of overcoming the problem, using "without indirect_include".
I am fairly certain that this solution would be sufficient for me.
Thank you.