comp.lang.ada
 help / color / mirror / Atom feed
From: steve@sdcrdcf.UUCP (Steven Holtsberg)
Subject: Ada reference manual inquiry
Date: Tue, 5-Aug-86 00:08:22 EDT	[thread overview]
Date: Tue Aug  5 00:08:22 1986
Message-ID: <2929@sdcrdcf.UUCP> (raw)


Perhaps the ARM answers this question somewhere, but I haven't
been able to find it.

When operators are described, and the ``types'' of their operands
are given, do they really mean ``types'', or do they mean ``subtypes''?

For example, on page 4-16 (section 4.5.3), when describing ``+'',
the manual says that the left operand can be of ``any numeric type'',
and the right operand must be of the ``same numeric type''.

Do they really mean what I think- that is, in X + Y,
if X is a subtype of INTEGER, say POSITIVE, and Y is a another sybtype
of INTEGER, say NEGATIVE, then the _type_ of X is INTEGER
(although it is of subtype POSITIVE) and the _type_ of Y is
INTEGER, so X + Y is legal, and it is of type INTEGER?

Or do they mean that X and Y must be of the same subtype, so
if X is POSITIVE, then Y must be positive, and X + Y is
POSITIVE?

More generally, what is the _type_ of any constant or a variable?
Is it the subtype it was declared to have, or the base type?

Note that on page 3-4, the ARM says that (line 5) the _subtype_
of an object is determined by the object declaration.
But, it does not say whether this _subtype_ of the object
is also its _type_ of the object, or whether the _type_
of the object is actually the base type.

If you know the answer, please also back it up with references in the ARM.

Thanks

Steven Holtsberg
-------------------------------------------------------------
sdcrdcf!steve@ucla-cs or holts@ucla-cs

             reply	other threads:[~1986-08-05  4:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-08-05  4:08 Steven Holtsberg [this message]
1986-08-05 19:12 ` Ada reference manual inquiry Larry Wall
replies disabled

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