August Karlstrom
2015-03-09 10:47:26 UTC
In the programming language C the pointer base type of a formal pointer
parameter can be write-protected by adding the keyword `const' before
the parameter*, for instance
typedef struct { ... } *T;
int F(const T x);
In Oberon-07/14, does the "constantness" of a formal pointer value
parameter apply only to the pointer or does it also extends to the
record it points to? For instance, in the declaration of F below, can
fields of x be assigned to from within F or do we need to make x a
variable parameter to do so?
T = POINTER TO RECORD ... END
PROCEDURE F(x: T): INTEGER
-- August
*Of course, all type rules can be violated in C if the implementor wants
to do so.
parameter can be write-protected by adding the keyword `const' before
the parameter*, for instance
typedef struct { ... } *T;
int F(const T x);
In Oberon-07/14, does the "constantness" of a formal pointer value
parameter apply only to the pointer or does it also extends to the
record it points to? For instance, in the declaration of F below, can
fields of x be assigned to from within F or do we need to make x a
variable parameter to do so?
T = POINTER TO RECORD ... END
PROCEDURE F(x: T): INTEGER
-- August
*Of course, all type rules can be violated in C if the implementor wants
to do so.