comp.lang.ada
 help / color / mirror / Atom feed
From: Wes Groleau <wesgroleau@despammed.com>
Subject: Re: Ada Basics
Date: Wed, 09 Oct 2002 12:44:00 -0500
Date: 2002-10-09T12:44:00-05:00	[thread overview]
Message-ID: <3DA46AE0.2D996D39@despammed.com> (raw)
In-Reply-To: 3DA45046.F5C66738@raytheon.com



Jerry Petrey wrote:
> In the example you cited, there would be little difference since all integer
> types
> are derived types - type one_to_hundred is range 1..100 creates a derived
> type but the compiler chooses which predefined integer type to derive from (it
> might for
> example, choose short_integer).
> With  one_to_hundred is new Integer range 1..100 , you are explicitly choosing
> 
> the parent type to be the predefined type Integer.

The implementation (size, for example) is also inherited.
Which is why one might choose a particular parent.

But also, by making a derived type instead of a (plain) new type,
you may be sending a message to future readers that the parent
type specifically has operations that are important to the derived type.

-- 
Wes Groleau
http://freepages.rootsweb.com/~wgroleau



  reply	other threads:[~2002-10-09 17:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-09 12:53 Ada Basics prashna
2002-10-09 15:27 ` Georg Bauhaus
2002-10-09 15:50 ` Jerry Petrey
2002-10-09 17:44   ` Wes Groleau [this message]
2002-10-09 18:37 ` Matthew Heaney
2002-10-09 18:58   ` David C. Hoos
2002-10-09 19:09     ` Matthew Heaney
2002-10-09 20:05 ` Robert A Duff
2002-10-10 10:47 ` prashna
replies disabled

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