From: "Toshitaka KUMANO" <[log in to unmask]>
> How about if rewriting like below ?
>
> if Left <= Right then
> declare
> D : Some_Decrete_Type := Left;
> begin
> loop
> sequence_of_statements
> exit when D >= Right;
> D := Some_Decrete_Type'Succ (D);
> end loop;
> end
> end if;
>
That's better, but still not equivalent if the computations of Left and Right are function calls with side-effects (they are
computed more than once). Have another try!
(BTW: this is really an interesting exercise, that shows how Ada compilers have to be careful!)
---------------------------------------------------------
J-P. Rosen ([log in to unmask])
Visit Adalog's web site at http://www.adalog.fr