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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,640b65cbfbab7216 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!postnews.google.com!a9g2000prl.googlegroups.com!not-for-mail From: Eric Hughes Newsgroups: comp.lang.ada Subject: Re: Ada.Strings.Bounded Date: Tue, 15 Apr 2008 07:20:15 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <47F652F7.9050502@obry.net> <47f7028d$1_6@news.bluewin.ch> <47F749CB.30806@obry.net> <96x8my4o4m7e.fskzcb6i31ty$.dlg@40tude.net> <276e98e3-3b3b-4cbf-b85c-dcae79f11ec5@b5g2000pri.googlegroups.com> <013e1d52-c25f-49ea-83ef-6ac4860858bf@s13g2000prd.googlegroups.com> <8g2rpvi2ahu0$.1ebsyq5yu1whf.dlg@40tude.net> <9a3ad8ca-9f44-42db-9f7c-c5f9e3ee60f3@w1g2000prd.googlegroups.com> <1jdzw15tbj376$.nyv9yml75wj4$.dlg@40tude.net> <80c6fdca-1a89-4d98-b61d-9a405e57d8e5@s13g2000prd.googlegroups.com> <1wh7cbu67y4wz$.7iu8likx0fct.dlg@40tude.net> NNTP-Posting-Host: 166.70.57.218 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1208269215 20838 127.0.0.1 (15 Apr 2008 14:20:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 15 Apr 2008 14:20:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a9g2000prl.googlegroups.com; posting-host=166.70.57.218; posting-account=5RIiTwoAAACt_Eu87gmPAJMoMTeMz-rn User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20958 Date: 2008-04-15T07:20:15-07:00 List-Id: On Mon, 14 Apr 2008 19:07:25 -0700 (PDT), Eric Hughes wrote: > Seriously, we just disagree about this. I can't take > universal_integer seriously as a root class, because it's impossible > to write down any representation of it. On Apr 15, 2:02 am, "Dmitry A. Kazakov" wrote: > Yes, because it is not what you wanted it be. My belief about universal_integer is rooted in the language definition. I assert that that Ada as currently defined has no bound on the size of numbers within universal_integer. Here is my argument. The best definition is in ARM 3.4.1(6/2-7). (Defect report: this doesn't appear in the index entry for universal_integer.) Wherein: > The set of values of a universal type is the undiscriminated > union of the set of values possible for any definable type > in the associated class. The associated class to universal_integer is the signed integer type (3.5.4), delineated by ranges given by static simple_expression. There's no length limitation on an expression in the language, so arbitrarily large ranges are possible. Thus I can define the following series of types: type I1 is range -2^10 .. 2^10 ; type I2 is range -2^100 .. 2^100 ; type I3 is range -2^1000 .. 2^1000 ; -- ... The exponent in I(n) is an integer within the range of I(n-1). The type of an integer literal is universal_integer (2.4), which means that if I(n-1) is well-defined, then so is I(n). (Hence the requirement for bignum arithmetic in the compiler.) If you want to exhibit a bound on universal_integer as a counterexample, I will take its logarithm, round up, and add 1, and use that index to exhibit a type definition that exceeds this bound. Every integer is thus a member of universal_integer. If you can show me a Ada definition that can store a universal_integer, only then will I believe you that it's the kind of type that's just like an ordinary Ada type. Perhaps you could explain what you want universal_integer to be. Eric