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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Mart van de Wege Newsgroups: comp.lang.ada Subject: Re: Latest suggestion for 202x Date: Mon, 17 Jun 2019 14:01:43 +0200 Message-ID: <86h88obeu0.fsf@gaheris.avalon.lan> References: <728c4668-8fa0-4a57-a502-2bf476fc3940@googlegroups.com> <4908c3e3-18dc-4953-bf26-46f160d2ebfd@googlegroups.com> <9dcf22a2-2255-4089-b1f0-93e31448415e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain X-Trace: individual.net XXviasMimGYnG1TUctdTbga0mLz/iVgSCNOlIztgwWo7VHz6Ly X-Orig-Path: gaheris.avalon.lan!not-for-mail Cancel-Lock: sha1:s5jugJ+K6l7UW9u6s/dIV3r0i7U= sha1:QQEuN0HIyt0UI9Wu2kwny1+62NQ= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Xref: reader01.eternal-september.org comp.lang.ada:56660 Date: 2019-06-17T14:01:43+02:00 List-Id: Maciej Sobczak writes: >> An array can be easily swapped for a function without requiring > major changes all over the place, as array indexing and function calls > have the same syntax. > > A(I) := 7; > > Swap(A(I), A(J)); > > Sort_Subarray(A(1..10)); > > ... > > Not really. > > Arrays are *not* exchangeable with function calls. Conceptually, an array indexing operation *is* a function call. This is especially clear when the array elements do not directly map to memory locations, because then you need to implement an algorithm to find the nth element of an array. And even if they directly map there is a function call, even if it as simple as 'increment the address pointer by the difference of the index and the base address'. Mart -- "We will need a longer wall when the revolution comes." --- AJS, quoting an uncertain source.