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

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Sat May 15 18:39:59 CEST 2021


Thanks, Josef, I can now see how such a “feature” might actually be
useful (although I’ve never used it nor did I know it has apparently
existed all along since Pascal days). So I resist the temptation..

-Andreas


> Standard procedures in Oberon live in the outmost (global) scope on purpose
> and the reason is extensibility. It makes it possible to add new procedures
> later without invalidating any existing programs. This is so in all Pascal
> style languages and their successors. It is very cheap to implement in the
> compiler and fits well with the nesting of scopes. Overriding such
> procedures locally is thereby possible but used mainly when a new procedure>
> happens to be added in a new language version or dialect and an object with
> the same name already exists in a program. The locally defined name then
> shadows the same name in the global scope and the program compiles and runs
> as before.
>
> I would not recommend to remove this feature.
>
> - Josef


More information about the Oberon mailing list