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!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Bob Duff Newsgroups: comp.lang.ada Subject: Re: New to Ada, why these warning messages? Date: Fri, 01 Jan 2016 16:18:00 -0500 Organization: A noiseless patient Spider Message-ID: <87bn95yp6f.fsf@theworld.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="81112f14cab07c2d3027322ae68a65fb"; logging-data="24243"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/2n4qeeIQfYgPGJxbhfT+V" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:wXtiaYlCdBzR9AdJla824L4xtxc= sha1:E1X5Q0nDO71iJlArtJTjzygLUqg= Xref: news.eternal-september.org comp.lang.ada:28972 Date: 2016-01-01T16:18:00-05:00 List-Id: "Jeffrey R. Carter" writes: > This would be better written > > (Atype'range => Blue) > > or > > (Paint => Blue) Even better: C := (others => Blue); >> -- Print out the contents of each of A, B, and C. >> for I in 1..N loop > > for I in A'range loop > >> Put(PNames(A(I)) & " "); In Ada 2012 you can say: for X of A loop Put(PNames(X) & " "); That's better, because it leaves out the extraneous object I, which has nothing to do with the problem being solved. - Bob