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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: syntaxic exploration Date: Sun, 24 Dec 2017 15:39:56 +0200 Organization: Tidorum Ltd Message-ID: References: <0d33e631-e63d-4346-ac95-5eec72127f4f@googlegroups.com> <0fa75dd5-599b-4a38-a5d4-3151bbe5172f@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net fnPCOZfchiFHa4UpjJRIdAoqxMx4Ie5ZW7i4mLndCHcgHLeoOa Cancel-Lock: sha1:qhpoSKb0gV/NgUPW6UlSQQbtRco= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Xref: reader02.eternal-september.org comp.lang.ada:49623 Date: 2017-12-24T15:39:56+02:00 List-Id: On 17-12-24 05:37 , Robert Eachus wrote: > On Saturday, December 23, 2017 at 11:23:32 AM UTC-5, Jeffrey R. > Carter wrote: >> On 12/22/2017 11:11 PM, Niklas Holsti wrote: >>> >>> I think the aggregate form (null array) was suggested some time >>> ago, in analogy with the existing (null record). It looks good to >>> me, but as I remember, there was some objection. One problem is >>> that if the index type has exactly one value, then a null array >>> with that index type cannot exist (because then A'First = A'Last >>> for any such array A). [snip] > A more complex, and potentially ugly case is for multidimensional > arrays. Defining (null array) as being empty in all dimensions with > Foo'Range(n) = Bar'First..Bar'Pred(Bar'First) where Bar is the nth > index SUBtype for Foo works. In other words, the same as the current rule for the null string literal "". > In general, you should be surprised if Foo'Last(N) for a null > array doesn't raise Constraint_Error. That is not true in current Ada, as I understand it. That would be very bad -- it would mean that any general operation that loops over an array that is potentially null would have to first check the 'Length. Fortunately this is not the case. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .