comp.lang.ada
 help / color / mirror / Atom feed
From: "framefritti@gmail.com" <framefritti@gmail.com>
Subject: Re: Curiosity about rage checking
Date: Thu, 7 Feb 2008 02:36:01 -0800 (PST)
Date: 2008-02-07T02:36:01-08:00	[thread overview]
Message-ID: <d72f0b00-f44d-4e10-be01-577beddcfbfc@j20g2000hsi.googlegroups.com> (raw)
In-Reply-To: fikeof.nrj.ln@hunter.axlog.fr



Jean-Pierre Rosen ha scritto:

> framefritti@gmail.com a �crit :
> > [..]
> >
> > My question is: is an Ada compiler allowed to move the check outside
> > the loop?
>
> This question is addressed in the (in)famous paragraph 11.6. If you
> don't understand exactly what it says, don't worry, you are not alone...
>
> But the important issue is that compilers are unlikely to perform that
> optimization. Why? Because optimization is a matter of improving what's
> normally used. And any decent Ada programmer should write that loop as:
>
> for I in X'range loop...
>
> Where the optimization becomes trivial

I agree, and that is what I usually do, but there are times when you
want to loop
over a limited part of X or not in the usual order (e.g., transposing
a matrix stored (for whatever
reason) as a one-dimensional array)
> --
> ---------------------------------------------------------
>             J-P. Rosen (rosen@adalog.fr)
> Visit Adalog's web site at http://www.adalog.fr



  reply	other threads:[~2008-02-07 10:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07  8:17 Curiosity about rage checking framefritti
2008-02-07  8:45 ` Maciej Sobczak
2008-02-07  9:55 ` Jean-Pierre Rosen
2008-02-07 10:36   ` framefritti [this message]
2008-02-07 11:21     ` Dmitry A. Kazakov
2008-02-07 15:57   ` Adam Beneschan
2008-02-07 16:45 ` Robert A Duff
2008-02-07 16:54 ` Adam Beneschan
replies disabled

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