[Oberon] Should hidden re-imports be able to coexist with identifiers

Luca Boasso luke.boasso at gmail.com
Sun May 16 03:13:24 CEST 2021


Why? Because I view it is a desirable property if the compiler, if it
> encourages
> the programmer to write the import list of a module in the “right” order,
> i.e.
> reflecting the module hierarchy.. fully knowing that enforcing the rule
> that
> explicit imports must always become before re-imports may in some (rare?)
> cases force the programmer of a client module to change the import order,
> if the programmer of an imported module changes *its* import list.
>
>
>
I have two problems in forcing the programmer to think about import
ordering:
1. It does not scale. If you have big systems it is hard to hold in your
head
   all the import relationships. It is better to have the compiler figure
it out
   for you and do the proper checks.
2. It breaks encapsulation. If I (module B) import a module A, I should
only care
   about its public interface, not how it is implemented. So if the module
A
   re-imports types and indirectly could mess with the import order of my
   module B, we have implementation details leaking through. So when the
   implementation changes the import order of the client modules could
break.


> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20210515/f8556ea0/attachment-0001.html>


More information about the Oberon mailing list