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-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!c9g2000yqm.googlegroups.com!not-for-mail From: AdaMagica Newsgroups: comp.lang.ada Subject: Re: unsigned type Date: Mon, 6 Jul 2009 02:04:55 -0700 (PDT) Organization: http://groups.google.com Message-ID: <0bb3d608-b73d-4eea-b903-39beb0aa5861@c9g2000yqm.googlegroups.com> References: <273dedb7-8d68-42d2-8602-aa44c79f3708@b9g2000yqm.googlegroups.com> <4b83m.98382$d36.15650@bgtnsc04-news.ops.worldnet.att.net> <4a4e7705$0$31863$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: 80.156.44.178 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1246871095 18009 127.0.0.1 (6 Jul 2009 09:04:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 6 Jul 2009 09:04:55 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c9g2000yqm.googlegroups.com; posting-host=80.156.44.178; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 webwasher (Webwasher 6.8.3.4555) Xref: g2news2.google.com comp.lang.ada:6856 Date: 2009-07-06T02:04:55-07:00 List-Id: On Jul 4, 11:09=A0am, a...@anon.org (anon) wrote: > =A0 =A0 =A0 =A0 A String literal is define in RM 4.2 ( 4, 11 ) with the S= tring > type defined in RM 3.6.3 ( 4 ) and its index type (Positive) is define > in RM 3.6.3 ( 3 ) and RM 3.5.4 ( 13 ). =A0With the Positive base range > being Natural defined by RM 3.5.4 ( 13..14 ). and a lot more wrong statements. Positive'Base is not Natural. You mix up 'subtype', 'type of a subtype', 'base type'. They are all different. Please see: http://en.wikibooks.org/w/index.php?title=3DAda_Programming/Type_System&sta= ble=3D0&shownotice=3D1#Elaborated_Discussion_of_Types_for_Signed_Integer_Ty= pes In short: The 'type' of an integer type comprises the complete set of mathematical integers (yes, indeed). The base type of a subtype is some compiler chosen hardware type that comprises all values of the first subtype. type Some_T is range 0 .. 10; You may believe it or not, 10**10_000 is a value of the type of Some_T; Some_T is not a type, it's the first subtype of the type of Some_T. It's of course not in Some_T'Base for any of today's machines (and won't be for a long time to come). The type of T is denoted in the RM with italized font. X: constant :=3D Some_T'Last + 10**10_000; -- type of X is Universal_Integer, calculated as follows: The result will be mathematically exact (no overflow check except for a limitation by computer store) with the "+" operator of (the type of) Some_T. The literals 10 and 10_000 are of type Universal_Integer. 10 will be implicitly converted to (the type of) Some_T or some such, 10_000 to (the type of) Standard.Integer, then "**" will be applied to the result returning a value of the type of Some_T. At the end, the result is implicitly converted back to Unversal_Integer. Universal_Integer has no operators! So with this in mind, please rethink your arguments about String (1 .. 0), String (-5 .. -7) etc... (This is my personal exegesis of the RM. Hope it's correct.)