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 X-Received: by 10.129.109.206 with SMTP id i197mr20366085ywc.63.1483537453302; Wed, 04 Jan 2017 05:44:13 -0800 (PST) X-Received: by 10.157.14.183 with SMTP id 52mr115470otj.20.1483537453254; Wed, 04 Jan 2017 05:44:13 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!2.eu.feeder.erje.net!feeder.erje.net!2.us.feeder.erje.net!newspeer1.nac.net!border2.nntp.dca1.giganews.com!nntp.giganews.com!d45no101666qta.0!news-out.google.com!u18ni3371ita.0!nntp.google.com!b123no192323itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 4 Jan 2017 05:44:12 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:2ab8:224:1:ac1b:12f9:145d:7968; posting-account=F4OyugoAAABQod8iTn6AU7wMocsaGOvw NNTP-Posting-Host: 2a02:2ab8:224:1:ac1b:12f9:145d:7968 References: <87r34j39u6.fsf@nightsong.com> <7643d59e-061f-42df-adda-9322608f127b@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5b52afcc-120e-41a5-bab2-7f5c6f647cc2@googlegroups.com> Subject: Re: Introductory Ada Programming Book From: raph.amiard@gmail.com Injection-Date: Wed, 04 Jan 2017 13:44:13 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:33042 Date: 2017-01-04T05:44:12-08:00 List-Id: I'm in contact with the author so I'll pass any fixes up to him if you don't mind > exit when (a == 0) > Switch statements must cover all possible input values --- for unbounded > types like integers, a when others is mandatory. I imagine you refer to the use of "unbounded" when refering to the integer type ? > Oddly, variables are not initialised by default > (Personal opinion: default initialization is a huge mistake) Ok but, besides the "oddly" qualifier, his statement is correct, right ? > > Ada is, alas, a one-pass language, so things need to be prototyped if > you're going to refer to them before they're defined. This is generally true, and the areas of the language where it's not (aspects) are full of gotchas. While it's not always true, my feeling is that there *was* a strong push to keep Ada compilable by a one pass compiler (which GNAT is, in broad strokes). > > Plus you can omit the parentheses when calling zero-argument functions > and procedures; > (You must!) Ok > > type Vector is array(integer range<>) of float; > These are a little bit deceptive. They don't represent an array which > can change in size; they represent an array whose size is not known by > the type system. They're implemented via a combination of fat pointers > and fixed-size arrays, depending on context. They can be used as a > shortcut in declaring variables, but they're mostly useful as parameters. I'm not sure what is incorrect here. > Often not really wrong, but imprecise or incorrect Imprecise strikes me as completely OK for such a post. Incorrect is another matter, hence my original question :)