[Oberon] Assignment to value parameters of pointer or procedure type
August Karlstrom
fusionfile at gmail.com
Sat Feb 15 13:36:54 CET 2025
On 2025-02-09 16:48, Florian Negele wrote:
> Procedure and pointer types are unstructured and thus basic in the
> original Oberon and maybe in Oberon-07, but clearly not in Oberon-2.
Maybe it's better then to use the terms "scalar type" and "predeclared
type" respectively to avoid confusion.
The language report says that the second parameter of SYSTEM.GET and
SYSTEM.PUT can be "any basic type" which I then interpret as any
predeclared type or any pointer or procedure type, i.e. any scalar type.
For SYSTEM.VAL it says "scalar" and it's not clear to me why the wording
is different here.
https://miasap.se/obnc/oberon-report.html#sec11.1
I also noticed that in the Project Oberon compiler there seems to be no
type checking of the second parameter, for instance this module compiles
despite a and r being non-scalar parameters:
MODULE Test;
IMPORT SYSTEM;
VAR
a: ARRAY 10 OF INTEGER;
r: RECORD END;
BEGIN
SYSTEM.GET(0, a);
SYSTEM.GET(0, r)
END Test.
/August
More information about the Oberon
mailing list