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,6aa1ec264ce25142 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.88.168 with SMTP id bh8mr2022586pab.10.1346194741371; Tue, 28 Aug 2012 15:59:01 -0700 (PDT) Received: by 10.68.237.163 with SMTP id vd3mr7084pbc.9.1346194741348; Tue, 28 Aug 2012 15:59:01 -0700 (PDT) Path: a8ni87145150pbd.1!nntp.google.com!r4no1040349pbs.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 28 Aug 2012 15:59:01 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ NNTP-Posting-Host: 66.126.103.122 References: <1p5r39cusgc1n$.18nj9sytckk6$.dlg@40tude.net> <874nnmhki2.fsf@mid.deneb.enyo.de> <027d5417-06c0-46f5-a04a-70269f593b18@googlegroups.com> <090f7d43-21c1-480d-8428-96c1c59ec7f2@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Real syntax problems in Ada From: Adam Beneschan Injection-Date: Tue, 28 Aug 2012 22:59:01 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-08-28T15:59:01-07:00 List-Id: On Tuesday, August 28, 2012 2:25:09 PM UTC-7, Shark8 wrote: > On Tuesday, August 28, 2012 3:07:32 PM UTC-6, Adam Beneschan wrote: >=20 > > On Tuesday, August 28, 2012 1:53:01 PM UTC-7, Shark8 wrote: >=20 > >=20 >=20 > > In the past, I've wanted something like (null array), which would be co= nsistent since Ada already has (null record). The language would have to d= efine what the actual bounds of the array are, however, since a program can= still refer to A'First or A'Last and they have to be defined to be somethi= ng. Starting with Ada 2005, it's now possible to say (1..0 =3D> <>), which= makes things better than they were before--at least there's no more proble= m of having to come up with a dummy value to put on the right side of the a= rrow. >=20 >=20 >=20 > Except in the case of an array of not null access values. :( >=20 > (At least w/ GNAT; it rejects <> because the default is null, which is ex= cluded.) Hmmm... I can't even get GNAT to display a warning. I'm using 4.5.2. Anyway, the behavior seems wrong; I can't find any Legality Rule that makes= it illegal to declare an uninitialized object of any kind whose type is nu= ll-excluding access. Of course it will raise Constraint_Error at runtime, = although it won't in a (1..0 =3D> <>) case since the program doesn't attemp= t to initialize any values. I'm sure GNAT has a nonstandard mode that will= reject a program if it "knows" there is something that is sure to raise an= exception like this, but it shouldn't be doing it here. -- Adam