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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fad7742cc8dcbb84 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bos-service1.raytheon.com!dfw-service2.ext.ray.com.POSTED!53ab2750!not-for-mail From: Jeffrey Carter User-Agent: Mozilla Thunderbird 1.0.5 (Windows/20050711) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: type and subtype References: <1122215078.559279.16980@f14g2000cwb.googlegroups.com> <87mzocrx9d.fsf@insalien.org> <_vPEe.3516$Uk3.77@newsread1.news.pas.earthlink.net> In-Reply-To: Content-Type: multipart/mixed; boundary="------------040007020502000303060206" Message-ID: <0L7Fe.3$Jf6.1@dfw-service2.ext.ray.com> Date: Mon, 25 Jul 2005 08:41:48 -0700 NNTP-Posting-Host: 147.24.111.90 X-Complaints-To: news@ext.ray.com X-Trace: dfw-service2.ext.ray.com 1122306108 147.24.111.90 (Mon, 25 Jul 2005 10:41:48 CDT) NNTP-Posting-Date: Mon, 25 Jul 2005 10:41:48 CDT Organization: Raytheon Company Xref: g2news1.google.com comp.lang.ada:3755 Date: 2005-07-25T08:41:48-07:00 List-Id: This is a multi-part message in MIME format. --------------040007020502000303060206 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Dmitry A. Kazakov wrote: > > I think that Ludovic's view is more consistent: checks are just a part of > the conversion which otherwise is an identity function, because *presently* > the representation is required to be same. But representation is an > implementation detail and thus cannot count. Moreover it is very desirable > to allow subtypes having different representations. Try this with your favorite compiler: Ada.Text_IO.Put_Line (Item => "Integer'Size =" & Integer'Image (Integer'Size) ): Ada.Text_IO.Put_Line (Item => "Natural'Size =" & Integer'Image (Natural'Size) ): You're likely to get something like Integer'Size = 32 Natural'Size = 31 because representations of subtypes are not required to be the same. We can also consider type Rec (Length : Positive) is record V : String (1 .. Length); end record; subtype Small is Rec (Length => 1); subtype Big is Rec (length => 1_000); where Small and Big have significantly different representations. Then there are subtypes of variant record types with discriminants that select different variants. --------------040007020502000303060206 Content-Type: text/x-vcard; charset=utf-8; name="spam.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="spam.vcf" begin:vcard fn:Jeffrey Carter n:;Jeffrey Carter email;internet:jeffrey_r_carter-nr [commercial-at] raytheon [period | full stop] com x-mozilla-html:FALSE version:2.1 end:vcard --------------040007020502000303060206--