comp.lang.ada
 help / color / mirror / Atom feed
From: Jean-Pierre Rosen <rosen@adalog.fr>
Subject: Re: types and subtypes
Date: Tue, 14 Mar 2006 15:39:15 +0100
Date: 2006-03-14T15:39:15+01:00	[thread overview]
Message-ID: <kik6vd.62o.ln@hunter.axlog.fr> (raw)
In-Reply-To: <1142273325.634632.41020@j52g2000cwj.googlegroups.com>

ada_student@yahoo.com a �crit :
>> 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.
No, Ada's definition of a *sub*type is different.

> A type also defines the set of values that an object can have.
That's correct.

In other languages, a subtype is a sub-type, i.e. a type "sub" (under) 
another type.

In Ada, a type is a set of value; a subtype is a subset of that set. 
Since a subset is included in the set, a subtype is included in (and of 
same nature as) the type.

-- 
---------------------------------------------------------
            J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



  parent reply	other threads:[~2006-03-14 14:39 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
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 [this message]
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