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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: dave_thompson_2@comcast.net Newsgroups: comp.lang.ada Subject: Re: Beginning Ada Programming, by Andrew T. Shvets (2020) Date: Sat, 02 May 2020 15:13:10 -0400 Organization: A noiseless patient Spider Message-ID: <0dhraftqat1knq4ish274hj6kafp18acbr@4ax.com> References: <87muca3vgd.fsf@nightsong.com> <57d49047-0a61-4d13-8822-d004732a3acc@googlegroups.com> <007895f7-b923-4267-9801-d0caaaa30838@googlegroups.com> <41ef6a77-3b14-43ff-b6ae-510000a33ad4@googlegroups.com> <9f2bfb05-fb5e-45cf-909e-53629b939da3@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: reader02.eternal-september.org; posting-host="0c47c48c68d411b544f09cc88c4e973c"; logging-data="14760"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+5XxSJNA/b9tY0bB9ciW8tmQGOu/+c8Mg=" Cancel-Lock: sha1:E62b5luSjK/I0xJVmI0rrCgvu5w= X-Newsreader: Forte Agent 3.3/32.846 Xref: reader01.eternal-september.org comp.lang.ada:58556 Date: 2020-05-02T15:13:10-04:00 List-Id: On Sat, 18 Apr 2020 09:34:29 -0700 (PDT), cantanima.perry@gmail.com wrote: > - C++ and Java have the for (auto a : A) { } construct;*** ... > ***The C++ and Java versions don't work on low-level arrays. ... Others have corrected this for C++ (works for array, or templated reference, but not C-style pointer-to-element) Java also supports it for arrays, and Java arrays are a little higher level: they carry their dimension even when passed as an argument. (Like C & C++, their origin or lowerbound is always zero.) Java formerly required you to specify the typename, redundantly, but since j10 (in 2018) it has 'var' (not 'auto', a trivial difference).