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,f9957894e0bdf128 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: How to put 200 into an integer sub-type of 16 bits (code included) Date: Fri, 16 Jan 2009 09:55:13 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <407ae64d-3cb3-4310-b59e-f1bbae9910a5@t39g2000prh.googlegroups.com> <71gqm49eatq868htrvd7eghm3m8su8kcbl@4ax.com> <7b017de2-951a-414a-8290-111353fe02f8@r15g2000prd.googlegroups.com> <46075a57-3445-44ae-b40e-dcad9e0e1fcf@v18g2000pro.googlegroups.com> <3d951e6e-c87d-4667-94ab-fcb312288e1d@r37g2000prr.googlegroups.com> <12837a65-dd6e-493f-91e8-4140d67237c2@z28g2000prd.googlegroups.com> <44178c17-a27b-48ff-8ff1-17d04d362ce4@a26g2000prf.googlegroups.com> <3b742adc-bbe7-4423-882e-6ca900671262@n41g2000yqh.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1232117713 28450 192.74.137.71 (16 Jan 2009 14:55:13 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 16 Jan 2009 14:55:13 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:nYgUsQzmn5ElECBweIcwfCFX27c= Xref: g2news2.google.com comp.lang.ada:4355 Date: 2009-01-16T09:55:13-05:00 List-Id: Adam Beneschan writes: > Yeah, but coming right after, and in the same paragraph as, a sentence > that says that "Size and Alignment clauses" are subtype-specific > clauses while all others are type-related, how the heck else is one > supposed to interpret it? I mean, if the RM goes to all the trouble > of distinguishing "subtype-specific rep items" from "type-related rep > items", wouldn't one assume that there's some actual reason for making > this distinction---and that the sentence that immediately follows it > provides that reason? I already admitted that it is confusing! Here's an example that illustrates the reason for having these definitions: type Root_Color is (Red, Orange, Yellow, Green); type Color is new Root_Color Red..Orange; for Color use (Red => 0, Orange => 1, Yellow => 2, Green => 4); for Color'Size use 1; subtype Mumble is Color'Base range Red..Yellow; The enum rep clause is type-related -- it's setting an aspect of the type, and this does not differ among different subtypes. The Size clause is subtype-related -- it's setting Color'Size to 1, but other subtypes of the same type have different sizes. Color'Base'Size is 3, and Mumble'Size is 2. I repeat: I agree with you that the wording is confusing. - Bob