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,1cd9f7e5a0d12003 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.195.165 with SMTP id if5mr23898123pbc.1.1337620658677; Mon, 21 May 2012 10:17:38 -0700 (PDT) Path: pr3ni21493pbb.0!nntp.google.com!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: condition true or false? -> (-1 < sizeof("test")) Date: Mon, 21 May 2012 13:16:18 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <95634f38f6ee0d116da523fdc2c9f5ca@dizum.com> <00240c6dd26962f50d5c57a933c137ef@dizum.com> <49eaf626-d504-472c-ae3b-cdb78595a82c@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1337620579 31661 192.74.137.71 (21 May 2012 17:16:19 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 21 May 2012 17:16:19 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:5mY4RDBk+6ABcFVyug6pp9fQU0E= Content-Type: text/plain; charset=us-ascii Date: 2012-05-21T13:16:18-04:00 List-Id: Adam Beneschan writes: > B := -1 < Some_Type'Size; > > where B is a Boolean, it works like this: Some_Type'Size is a > universal integer, and it can be converted to any integer type. > However, in a case like this where there's no variable or anything > else that tells the language which type to use, the language has a > preference for "root_integer", which is a signed integer type. So the > above would do what you expect (i.e. set B to True since 'Size can > never be negative). (The rule about preferring root_integer was added > in Ada 95. I don't know for sure whether the above is legal in Ada > 83; I think this might have been an error.) There was always a preference rule that made the above legal, even in Ada 83. It was changed slightly for Ada 95 to avoid some obscure Beaujolais effects. It was also reworded in terms of root_integer, which didn't exist in Ada 83. - Bob