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!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.lang.ada Subject: Re: syntaxic exploration Date: Fri, 22 Dec 2017 21:15:18 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <0d33e631-e63d-4346-ac95-5eec72127f4f@googlegroups.com> <0fa75dd5-599b-4a38-a5d4-3151bbe5172f@googlegroups.com> Injection-Date: Fri, 22 Dec 2017 21:15:18 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="1637cc8650e576cef9a16dc50fb56f37"; logging-data="1380"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+GJNr43hJbCYGzptxIdU/BHLDUa9HZzOk=" User-Agent: slrn/0.9.8.1 (VMS/Multinet) Cancel-Lock: sha1:Qbp5A1QgBylAgYW7cHqsBGPBopo= Xref: reader02.eternal-september.org comp.lang.ada:49594 Date: 2017-12-22T21:15:18+00:00 List-Id: On 2017-12-22, Robert Eachus wrote: > On Thursday, December 21, 2017 at 11:24:54 AM UTC-5, Jeffrey R. Carter wrote: >> On 12/21/2017 08:21 AM, Randy Brukardt wrote: >> > >> > Ada has no good way to write an empty array. I usually use (1 .. 0 => <>) >> > for that, but nothing is really satisfying. >> >> Except perhaps the empty array aggregate >> >> "" >> >> (only for string types, alas). > > Is it a reasonable language improvement request to allow "" for other > empty arrays? No. That would be too confusing IMHO because it would initially appear to be a string type to anyone unfamiliar with that part of the code and that just feels _way_ wrong. > Another possibility is the reserved word null. If that were > allowed I might even use it in place of "" for strings, because that is not > different enough from '"' when reading, depending on the type face used. > null is an interesting option for the empty array. However, for your strings idea, would people unfamiliar with the code and this new usage of null read this new usage as a null pointer instead of an empty string ? That could be confusing. The 1..0 notation is ugly but anyone who sees it knows instantly exactly what the original programmer meant. Any cleaner replacement should instantly come across as the empty array without the possibility of confusion because someone reused Ada syntax for this in an ambiguous way. Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world