Hi,
After having written some more ion code, I encountered yesterday my first name collision.
The main cost of the having all symbols contributed to a global namespace is that it creates collisions that can sometimes only be corrected by touching an intermediate module (rather than the module you're actively working on right now)
Imagine you have a main program residing in module: Program, using modules ModuleHello, ModuleWorld.
If ModuleHello imports ModuleBits unqualified:
Then any symbol from modulebits can collide with symbols of Program. The person having added the colliding symbol in Program might now has to chase all imports of modulebits and correct the importing module to import names with local qualified names.
Workarounds are:
1. to create generally unique names in modules (it's probably a good practice anyway, as it improves searchability) ; it's inevitable however that they will happen. Whether it indicates lack of reuse or bad naming, I don't know
2. always import qualified, explicitely:
import modulebits { modulebits_fn = fn } (although this still delays the inevitable collision when someone attempts to also import the same module
Those workaround require discipline, which is always in short-supply ;)
Oberon07 does not have this issue because:
- symbols have to be explicitly exported from a module.
- symbols imported via IMPORT are not themselves exported