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!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.ada Subject: Re: Latest suggestion for 202x Date: Fri, 21 Jun 2019 11:12:58 -0700 Organization: None to speak of Message-ID: References: <728c4668-8fa0-4a57-a502-2bf476fc3940@googlegroups.com> <4908c3e3-18dc-4953-bf26-46f160d2ebfd@googlegroups.com> <9dcf22a2-2255-4089-b1f0-93e31448415e@googlegroups.com> <86h88obeu0.fsf@gaheris.avalon.lan> <39e749cd-de5c-44fa-b8ec-50d36f3bd52c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="caa34a360db6aaf02b280eb2c1355383"; logging-data="8279"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Q5n8oZXGVQDo9hB3NVMMP" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:+29ZFGoOSGnPlrKMqrnFA/N0Bn8= sha1:arLjgw9gvdHsQCzXn8vihph19pk= Xref: reader01.eternal-september.org comp.lang.ada:56702 Date: 2019-06-21T11:12:58-07:00 List-Id: "Dmitry A. Kazakov" writes: > On 2019-06-21 00:21, Randy Brukardt wrote: >> "Keith Thompson" wrote in message >> news:lnef3rnb8d.fsf@kst-u.example.com... >> ... >>> I'm not at all persuaded by the argument that array indexing is >>> interchangeable with function calls. >>> >>> A(I) = 42; >> >> If A is a container, A(I) *is* a function call. QED. :-) > > It is many function calls actually. I wish it were just one: > > Array_Type'Component_Setter (A, I, 42) > > I think Keith probably meant something else, since it is self-evident > that array indexing is decomposable into calls to properly typed > subprograms (differently to, say, object construction). Of course the argument about interchangeability of array indexing and function calling goes back before containers existed in Ada. In my example, if A is an array variable and I've written A(I) = 42; I *can't* replace A by a function without modifying the code that uses it. Array indexing can appear on the LHS of an assignment; a function call cannot (or at least could not until recently). I suppose containers weaken that argument -- but if Ada had used [] for array indexing from the beginning, then presumably containers would have used that same syntax. (And again, I'm not suggesting a change to the language.) -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */