Discussion:
oberon-07 module system
(too old to reply)
nojb
2011-07-29 13:20:37 UTC
Permalink
Hello,

Is this valid according to the Oberon-07 specification?

MODULE A;
TYPE T* = ARRAY 10 OF INTEGER;
END A.

MODULE B;
IMPORT A;
VAR X : INTEGER; Y : A.T;
BEGIN
X := Y[3]
END B.

That is, when a type (e.g. A.T) is exported, is it exported as
an 'abstract' type (one we don't know the structure of),
or is it exported as a 'concrete' type (one we do know the
structure of)?

Thanks,
N
Chris Burrows
2011-07-30 00:13:54 UTC
Permalink
Post by nojb
Is this valid according to the Oberon-07 specification?
Yes.

--
Chris Burrows
CFB Software
Astrobe v3.4: ARM Oberon-07 Development System
http://www.astrobe.com
August Karlstrom
2011-07-30 10:17:14 UTC
Permalink
Post by nojb
Hello,
Is this valid according to the Oberon-07 specification?
MODULE A;
TYPE T* = ARRAY 10 OF INTEGER;
END A.
MODULE B;
IMPORT A;
VAR X : INTEGER; Y : A.T;
BEGIN
X := Y[3]
END B.
That is, when a type (e.g. A.T) is exported, is it exported as
an 'abstract' type (one we don't know the structure of),
or is it exported as a 'concrete' type (one we do know the
structure of)?
It is an interesting question you pose here. The array type is exported
as a concrete type in the same sense as a record type with public fields
(in both cases the structure will be visible in the module definition).
To make T an abstract type is of course trivial:

T* = RECORD
items: ARRAY 10 OF INTEGER
END


/August
--
The competent programmer is fully aware of the limited size of his own
skull. He therefore approaches his task with full humility, and avoids
clever tricks like the plague. --Edsger Dijkstra
Continue reading on narkive:
Loading...