Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Ansi -iso > Ordinal schema ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 174 of 211
Post > Topic >>

Ordinal schema in EP

by Waldek Hebisch <hebisch@[EMAIL PROTECTED] > Oct 21, 2005 at 02:04 PM

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]





 5 Posts in Topic:
Ordinal schema in EP
Waldek Hebisch <hebisc  2005-10-21 14:04:44 
Re: Ordinal schema in EP
John Reagan <john.reag  2005-10-24 16:02:55 
Re: Ordinal schema in EP
Waldek Hebisch <hebisc  2005-10-24 21:32:07 
Re: Ordinal schema in EP
John Reagan <john.reag  2005-10-26 15:10:32 
Re: Ordinal schema in EP
Waldek Hebisch <hebisc  2005-11-10 02:14:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon May 12 3:59:42 CDT 2008.