At the bottom of page 41 (in 6.47) EP standard contains the following
note:
'Extra' formal discriminants that do not occur in the type-denoter
of the schema-definition can be used to create several distinct, but
structurally-identical, types.
This seem to have strange consequences for ordinal types. Take:
type es(i: integer) = (c1, c2);
es1 = es(1);
Is the above legal? If yes, then what about c1 and c2? It seems that
the schema definition should declare also c1 and c2, but than what is
the type of c1 and c2? For me it looks more reasonable to define
c1 and c2 as a side effect of defining es1, but 6.4.2.3 says that
the occurence in enumerated-type (hence in the schema definition)
should be the defining point for c1 and c2. OTOH 6.4.8 says nothing
about enumeral types.
Next, look at:
type os(i: integer) = 0..100;
os1 = os(1);
From my reading of the standard os1 is a proper ordinal type, so
it can be used for variant selectors, array indices,
set elements and discriminants. It seems that with extra twist
it can be used as subrange bounds. Morover, once we can sneak
such types into subrange bounds we can reapeat the process recursively,
so we can store arbitrarly complex data in a single schema discriminant.
That adds a lot of complexity to the schema implementation. Is it
really what the standard says?
BTW, I got the impression that if we take a classic Pascal program
and replace every type declaration:
type t = ...
by
type t_s(i : integer) = ...
t = t_s(1);
then we should get correct EP program. Was that the intention of the
standard?
--
Waldek Hebisch
hebisch@[EMAIL PROTECTED]


|