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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.36.54.136 with SMTP id l130mr13161344itl.22.1514086660619; Sat, 23 Dec 2017 19:37:40 -0800 (PST) X-Received: by 10.157.64.68 with SMTP id o4mr477397oti.9.1514086660511; Sat, 23 Dec 2017 19:37:40 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!g80no2031468itg.0!news-out.google.com!b73ni6740ita.0!nntp.google.com!i6no2031595itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 23 Dec 2017 19:37:40 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8303:2100:5985:2c17:9409:aa9c; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8303:2100:5985:2c17:9409:aa9c References: <0d33e631-e63d-4346-ac95-5eec72127f4f@googlegroups.com> <0fa75dd5-599b-4a38-a5d4-3151bbe5172f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: syntaxic exploration From: Robert Eachus Injection-Date: Sun, 24 Dec 2017 03:37:40 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Body-CRC: 4283579505 X-Received-Bytes: 3138 Xref: reader02.eternal-september.org comp.lang.ada:49619 Date: 2017-12-23T19:37:40-08:00 List-Id: On Saturday, December 23, 2017 at 11:23:32 AM UTC-5, Jeffrey R. Carter wrot= e: > On 12/22/2017 11:11 PM, Niklas Holsti wrote: > >=20 > > I think the aggregate form (null array) was suggested some time ago, in= analogy=20 > > with the existing (null record). It looks good to me, but as I remember= , there=20 > > was some objection. One problem is that if the index type has exactly o= ne value,=20 > > then a null array with that index type cannot exist (because then A'Fir= st =3D=20 > > A'Last for any such array A). >=20 > Actually, a null array of such a type can exist if it's a string type, be= cause=20 > you can use the string literal "" for such types. AIUI, 'Last is undefine= d for=20 > such a value. Allowing (null array) for non-string array types with an in= dex=20 > type with a single value would presumably work the same. The rule that allows 1..0 as a null string range only has a problem if you = have an array with an enumeration index type containing a single component.= I think that is one of those cases where we say, "Don't do that!" and mov= e on. A more complex, and potentially ugly case is for multidimensional arrays. = Defining (null array) as being empty in all dimensions with Foo'Range(n) = =3D Bar'First..Bar'Pred(Bar'First) where Bar is the nth index SUBtype for F= oo works. If the last materialized is a (real) Numeric_Error AKA Constrain= t_Error? Again, only an issue for smart alecks. In general, you should be = surprised if Foo'Last(N) for a null array doesn't raise Constraint_Error.