comp.lang.ada
 help / color / mirror / Atom feed
* Follow-up to my original posting (Re: RM question concerning types)
       [not found] <21@dim.sm.unisys.com>
@ 1987-11-21  0:46 ` Steven Holtsberg
  1987-11-23 19:18   ` Follow-up to my original posting (R stt
  1987-11-24  1:46   ` 2nd follow-up to my previous posting (Re: RM question concerning types) Steven Holtsberg
  0 siblings, 2 replies; 4+ messages in thread
From: Steven Holtsberg @ 1987-11-21  0:46 UTC (permalink / raw)


I believe that if the following slight change were made to the reference
manual, it would be OK.

RM 3.5

For any scalar type T or for any subtype T of a scalar type, the
following attributes are defined:                                              7

T' FIRST	Yields the lower bound of T.  The value of this attribute
                has the same base type as T.
                             ^^^^
T' LAST		Yields the upper bound of T.  The value of this attribute
                has the same base type as T.
                             ^^^^

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Follow-up to my original posting (R
  1987-11-21  0:46 ` Follow-up to my original posting (Re: RM question concerning types) Steven Holtsberg
@ 1987-11-23 19:18   ` stt
  1987-11-24  1:46   ` 2nd follow-up to my previous posting (Re: RM question concerning types) Steven Holtsberg
  1 sibling, 0 replies; 4+ messages in thread
From: stt @ 1987-11-23 19:18 UTC (permalink / raw)



A scalar value doesn't *have* a "subtype"; it belongs to
each subtype of its type which includes the value in its range.

The only difference between
"base type" and "type" has to do with subtype issues, where
"base type" is really "base subtype," which is the subtype
with the maximal range supported by the type.

S. Tucker Taft
Intermetrics, Inc.
Cambridge, MA  02138

^ permalink raw reply	[flat|nested] 4+ messages in thread

* 2nd follow-up to my previous posting (Re: RM question concerning types)
  1987-11-21  0:46 ` Follow-up to my original posting (Re: RM question concerning types) Steven Holtsberg
  1987-11-23 19:18   ` Follow-up to my original posting (R stt
@ 1987-11-24  1:46   ` Steven Holtsberg
  1987-11-24 13:19     ` Robert Firth
  1 sibling, 1 reply; 4+ messages in thread
From: Steven Holtsberg @ 1987-11-24  1:46 UTC (permalink / raw)


In article <22@dim.sm.unisys.com> steve@dim.sm.unisys.com (I) write:
>I believe that if the following slight change were made to the reference
>manual, it would be OK.
>
>RM 3.5
>
>For any scalar type T or for any subtype T of a scalar type, the
>following attributes are defined:                                              7
>
>T' FIRST	Yields the lower bound of T.  The value of this attribute
>                has the same base type as T.
>                             ^^^^
>T' LAST		Yields the upper bound of T.  The value of this attribute
>                has the same base type as T.
>                             ^^^^

I was wrong.  In (RM) 3.3, it is stated that the base type
of a type is the type itself.  So, changing "type" to "base type"
does not change the above sentences.  Therefore, T, declared by

type T is range l..r

must be a subtype, not a type.  If T is taken as a subtype, then
the description in RM 3.5 is OK.

Now, the only question is why do they allow declaration of such static subtypes?
(E.g., type T is range l..r instead of subtype T is integer_type range l..r).
The only reason I can think of is to allow the particular implementation to
choose which base type to use--which of course, leads to non-portable code.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 2nd follow-up to my previous posting (Re: RM question concerning types)
  1987-11-24  1:46   ` 2nd follow-up to my previous posting (Re: RM question concerning types) Steven Holtsberg
@ 1987-11-24 13:19     ` Robert Firth
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Firth @ 1987-11-24 13:19 UTC (permalink / raw)


In article <23@dim.sm.unisys.com> steve@dim.sm.unisys.com (Steven Holtsberg) writes:

>Now, the only question is why do they allow declaration of such static subtypes?
>(E.g., type T is range l..r instead of subtype T is integer_type range l..r).
>The only reason I can think of is to allow the particular implementation to
>choose which base type to use--which of course, leads to non-portable code.

Sorry if the above was a typo, Steven, but the intent of a declaration such
as

	type INDEX is range 0 .. 100_000;

is to allow PORTABLE code.  The compiler is required to map this onto an
intrinsic type that has at least the required range.  For example, on a
VAX-11 the base type will be "longword", on an MC68020 it will be "long",
and so on.

The declaration can therefore be moved unchanged from one machine to
another.  Contrast this with the trouible the C folks in the nearby
newsgroup have with their "int" of who knows what size.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1987-11-24 13:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <21@dim.sm.unisys.com>
1987-11-21  0:46 ` Follow-up to my original posting (Re: RM question concerning types) Steven Holtsberg
1987-11-23 19:18   ` Follow-up to my original posting (R stt
1987-11-24  1:46   ` 2nd follow-up to my previous posting (Re: RM question concerning types) Steven Holtsberg
1987-11-24 13:19     ` Robert Firth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox