comp.lang.ada
 help / color / mirror / Atom feed
From: Bob Duff <bobduff@theworld.com>
Subject: Re: New to Ada, why these warning messages?
Date: Fri, 01 Jan 2016 16:18:00 -0500
Date: 2016-01-01T16:18:00-05:00	[thread overview]
Message-ID: <87bn95yp6f.fsf@theworld.com> (raw)
In-Reply-To: n6545n$cnt$2@dont-email.me

"Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org> 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

  reply	other threads:[~2016-01-01 21:18 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-01  2:19 New to Ada, why these warning messages? Dale Dellutri
2016-01-01  2:47 ` David Botton
2016-01-01  5:54 ` Jeffrey R. Carter
2016-01-01 21:18   ` Bob Duff [this message]
2016-01-01 17:30 ` Dennis Lee Bieber
2016-01-01 20:20 ` Dale Dellutri
2016-01-01 21:24   ` Bob Duff
2016-01-01 21:54     ` Dale Dellutri
2016-01-02 12:45       ` Simon Clubley
2016-01-02 14:21         ` Britt
2016-01-02 15:29           ` Simon Clubley
2016-01-03  7:11         ` J-P. Rosen
2016-01-03  9:32           ` Simon Wright
2016-01-03  9:59           ` Simon Clubley
2016-01-03 14:23             ` David Botton
2016-01-03 15:48             ` J-P. Rosen
2016-01-03 18:03               ` David Botton
2016-01-03 18:20                 ` Pascal Obry
2016-01-03 19:05                   ` David Botton
2016-01-01 23:50   ` Jeffrey R. Carter
2016-01-02 21:05     ` Bob Duff
2016-01-02 22:53       ` Jeffrey R. Carter
2016-01-02 17:59   ` Dennis Lee Bieber
2016-01-02 18:37     ` Paul Rubin
2016-01-02 21:03       ` Bob Duff
2016-01-02 21:08     ` Bob Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox