From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,38730e01f356adfa X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!j52g2000cwj.googlegroups.com!not-for-mail From: ada_student@yahoo.com Newsgroups: comp.lang.ada Subject: Re: types and subtypes Date: 13 Mar 2006 10:08:45 -0800 Organization: http://groups.google.com Message-ID: <1142273325.634632.41020@j52g2000cwj.googlegroups.com> References: <1142251677.837212.109000@i39g2000cwa.googlegroups.com> NNTP-Posting-Host: 202.137.222.207 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1142273331 29175 127.0.0.1 (13 Mar 2006 18:08:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 13 Mar 2006 18:08:51 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50215),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: j52g2000cwj.googlegroups.com; posting-host=202.137.222.207; posting-account=3Mg56g0AAACAuN289Qo7AHsl3oqAJBS- Xref: g2news1.google.com comp.lang.ada:3339 Date: 2006-03-13T10:08:45-08:00 List-Id: > 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?