comp.lang.ada
 help / color / mirror / Atom feed
* Ada reference manual inquiry
@ 1986-08-05  4:08 Steven Holtsberg
  1986-08-05 19:12 ` Larry Wall
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Holtsberg @ 1986-08-05  4:08 UTC (permalink / 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

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

end of thread, other threads:[~1986-08-05 19:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1986-08-05  4:08 Ada reference manual inquiry Steven Holtsberg
1986-08-05 19:12 ` Larry Wall

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