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.unit0.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: syntaxic exploration Date: Sat, 23 Dec 2017 09:15:35 +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=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net tiGgq8+vYtcDl4Pb0bbwjQ1zYIsdAZODJbpq8iX7R73H27oWBg Cancel-Lock: sha1:P9hH33fbwAR6EZty4IeNSkG2Uec= 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:49600 Date: 2017-12-23T09:15:35+02:00 List-Id: On 17-12-23 00:51 , Dmitry A. Kazakov wrote: > On 2017-12-22 23:11, Niklas Holsti wrote: > >> I think the aggregate form (null array) was suggested some time ago, >> in analogy with the existing (null record). > > These two totally different things. "null record" is not a record > aggregate (a value of record type), it is a type construct (a value of a > record type's type). Yes and no. Compare type Nothing is null record; -- Last choice in RM 3.8(3). and N : Nothing := (null record); -- Last choice in RM 4.3.1(3). So "null record" in a type declaration is a record_definition (RM 3.8(3)) but it can also occur in an expression as a record_component_association_list (RM 4.3.1(3)). Thus "(null record)" is a record aggregate. > Correspondingly "null array" would mean a type of > arrays rather than an empty aggregate of an array type. > >> I think (null array) satisfies that. I wish it could be introduced. > > If "" is QK, why () isn't? Could be, but parentheses are already so overloaded (which quotes are not) that I like (null array) better. > It could be an attribute as well: > > Empty : My_Array := My_Array'Null; Could be, but it is not much better than My_Array'(null array). > (You are right about indices. String has the lower bound set to 1. That > gives an unambiguous range of an empty string. No, for example (16 .. -40 => ' ') is an empty string, with bounds 16 .. -40. The index range of the empty string denoted by the null string literal "" is defined in the RM unambiguously. > For general case arrays it is ambiguous) Yes, the index bounds of "(null array)" would have to be specifically defined in the RM, similarly to the case for the null string literal. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .