comp.lang.ada
 help / color / mirror / Atom feed
* Re: Types, subtypes and ranges
@ 2001-03-14 13:50 Christoph Grein
  0 siblings, 0 replies; 9+ messages in thread
From: Christoph Grein @ 2001-03-14 13:50 UTC (permalink / raw)
  To: comp.lang.ada

Anders Wirzenius wrote:

> the 'Image attribute is inherited all the way up as long as
> you don't break the chain of subtypes:

Your wording is not quite correct. Inheritance is used in a different sense only 
for type derivation.

Here you have only subtypes, and these are no subtype-specific operations (OK, 
there are other subtype-specific attributes like 'Size). Thus e.g. 
Integer'Image, Natural'Image, Positive'Image all denote the same operation, 
there is no range check involved.

Positive'Image (-1) is absolutely OK and will return "-1" and not raise an 
exception.

The rationale behind this is that at some place you might not see the type, only 
the subtype.

(To be very precise, you never see a type name, only the first named subtype.)





^ permalink raw reply	[flat|nested] 9+ messages in thread
* Questions:
@ 2001-03-03  1:00 WM
  2001-03-07 23:05 ` Questions: Mark Lundquist
  0 siblings, 1 reply; 9+ messages in thread
From: WM @ 2001-03-03  1:00 UTC (permalink / raw)


Hi, I am an ada beginner. Can anyone kindly tell me what's the difference
between TYPE and SUBTYPE? And what's a PACKAGE?
Thank you very much :-)





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

end of thread, other threads:[~2001-03-20 16:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-14 13:50 Types, subtypes and ranges Christoph Grein
  -- strict thread matches above, loose matches on Subject: below --
2001-03-03  1:00 Questions: WM
2001-03-07 23:05 ` Questions: Mark Lundquist
2001-03-12  7:41   ` Types, subtypes and ranges Anders Wirzenius
2001-03-12 11:57     ` David C. Hoos, Sr.
2001-03-12 16:06       ` Tucker Taft
2001-03-13  6:40       ` Anders Wirzenius
2001-03-12 16:57     ` Scott Ingram
2001-03-18 22:28     ` Lao Xiao Hai
2001-03-19 13:22       ` Marc A. Criley
2001-03-20 16:57         ` Lao Xiao Hai

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