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: a07f3367d7,caabf5265fad78e5 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!f20g2000prn.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: unsigned type Date: Thu, 2 Jul 2009 19:10:51 -0700 (PDT) Organization: http://groups.google.com Message-ID: <2471ebe5-eca5-41c7-9ea1-8952f82876ac@f20g2000prn.googlegroups.com> References: <273dedb7-8d68-42d2-8602-aa44c79f3708@b9g2000yqm.googlegroups.com> <4b83m.98382$d36.15650@bgtnsc04-news.ops.worldnet.att.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1246587052 14841 127.0.0.1 (3 Jul 2009 02:10:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 3 Jul 2009 02:10:52 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f20g2000prn.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6816 Date: 2009-07-02T19:10:51-07:00 List-Id: On Jul 2, 6:42=A0pm, a...@anon.org (anon) wrote: > -- > -- Just a side note. =A0 Found while using a search engine. > -- > with Ada.Text_IO ; > use =A0Ada.Text_IO ; > > procedure Temp is > > =A0 =A0 C : constant String :=3D ( 1..0 =3D> 'A' ) ; > =A0 =A0 -- > =A0 =A0 -- =A0So, what happens to the 'A' and why does the compiler allow > =A0 =A0 -- =A0the constant 'A' when it result will be a null array. Nothing happens to it. This has been a known feature of Ada 83 and Ada 95 forever; the only way to set up an empty array aggregate is to provide a fake value. It was particularly annoying when you had an array of a record type; I often had to declare a useless dummy variable of that record type just so I could say (1 .. 0 =3D> Dummy). There have been proposals to allow "null array" similar to the (null record) aggregate, but they got nowhere. Those proposals aren't needed any more anyway, since in Ada 2005 you can say ( 1..0 =3D> <> ) regardless of the element type. > =A0 =A0 -- > =A0 =A0 -- =A0If you use ( 1..0 =3D> 'A' ) you must provide an unusable s= ingle > =A0 =A0 -- =A0Character, double quotes or emply quote are illegal. =A0Log= ic > =A0 =A0 -- =A0suggest that the statement should be > =A0 =A0 -- =A0C : constant String :=3D ( 1..0 =3D> '' ) ; Oh goodness. The syntax '' doesn't mean anything in Ada, and this would screw up every parser in the world because when they see two single quotes together they think it's going to be a single ' character, i.e. '''. Anyway, you can use <> so there's no longer any need for a new syntax. -- Adam