[Oberon] Module aliases - what is the correct way to handle them

Chris Burrows chris at cfbsoftware.com
Sun Feb 16 12:50:09 CET 2020


> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> Andreas Pirklbauer
> Sent: Saturday, 15 February 2020 10:49 AM
> To: Oberon List
> Subject: [Oberon] Module aliases - what is the correct way to handle
> them
> 
>     > > FULLY KNOWING that it is unnecessarily restrictive (one
> cannot, for
>     > > example, compile "IMPORT Z := M0, M0 := M1 in test module
> M5).
>     > >
>     > Unnecessarily?
> 
> You re right. One can argue that this should in fact be the *desired*
> behaviour.
> It is one of the reasons why I currently have this in my own
> implementation (the other one being that it has a real simple
> implementation).
> 
> But then  the community  argued that one should in fact comply with
> the language spec which has no such restrictions.
> 

I think that the language spec does have such a restriction. In one M0 is a module alias, in the other M0 is an actual module name. A single identifier (i.e. M0) can't be used for two different purposes in the same scope. 

If that is not true and a single identifier can be used twice in the import list then note that the report says nothing about the order in which the import list should be processed. Does that mean that:

IMPORT Z := M0, M0 := M1

Should be treated identically to 

IMPORT M0 := M1, Z := M0

just in case one implementation processes the list from left to right and the other from right to left?

That would be ambiguous so my conclusion is that both imports list are invalid and should result in an error message,

Regards,
Chris Burrows
CFB Software
https://www.astrobe.com





More information about the Oberon mailing list