comp.lang.ada
 help / color / mirror / Atom feed
From: ada_student@yahoo.com
Subject: Re: types and subtypes
Date: 13 Mar 2006 10:08:45 -0800
Date: 2006-03-13T10:08:45-08:00	[thread overview]
Message-ID: <1142273325.634632.41020@j52g2000cwj.googlegroups.com> (raw)
In-Reply-To: bjr3vd.ep4.ln@hunter.axlog.fr


> Because they are of the same *type*. A subtype does not declare a
> different type, only a restriction (a *constraint*) on the allowed
> values. Since the types are the same, the declaration is OK.
>

Then Ada's definition of a type is different from other languages.

A type also defines the set of values that an object can have.
If an Ada subtype adds a constraint to an Ada type, then the
subtype is a type that is a derivative(derivative as in the Ada
sense) of the Ada type and is different from that type.

[I know you can say "type T2 is new T1 ..." in Ada to denote
derivation]

Why doesnt Ada subtyping also denote derivation as in the
sense C++ base classes and derived classes do?

Why was Ada's subtyping defined to exclude derivation?




  reply	other threads:[~2006-03-13 18:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-13 12:07 types and subtypes ada_student
2006-03-13 13:20 ` Jean-Pierre Rosen
2006-03-13 18:08   ` ada_student [this message]
2006-03-13 18:17     ` Ed Falis
2006-03-13 19:14     ` Larry Kilgallen
2006-03-13 19:42     ` Martin Krischik
2006-03-13 20:22     ` Wilhelm Spickermann
2006-03-14  8:47     ` Dmitry A. Kazakov
2006-03-14 14:39     ` Jean-Pierre Rosen
2006-03-17  1:24     ` Peter C. Chapin
replies disabled

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