[Oberon] PO 2013 allows one to "override" predefined procedures and functions

Diego Sardina dsar at eml.cc
Fri May 14 16:14:16 CEST 2021


On Fri, May 14, 2021, at 3:29 PM, Andreas Pirklbauer wrote:
> Has anyone noticed that the PO 2013 allows the programmer
> to “overrride” predefined procedures and functions, e.g.,
> 
>   MODULE M;
>     VAR
>        INC: CHAR;
>        i: INTEGER;
>   BEGIN
>     INC := "a”;
>     INC(i)           (*not a procedure*)
>   END M.
> 
> This should not be allowed..
> 

For what I remember in Oberon every predefined identifier can be overridden since always.

This is the reason TRUE and FALSE were promoted to keyword in Oberon-07, to avoid CONST TRUE = FALSE.

But I agree that this shouldn't be allowed (and that promotion to keyword is debatable).

--
Diego Sardina


More information about the Oberon mailing list