TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
Date: Thu, 23 Aug 2001 11:29:13 +0200
Reply-To: Jean-Pierre Rosen <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="iso-8859-1"
Organization: Adalog
From: Jean-Pierre Rosen <[log in to unmask]>
Parts/Attachments: text/plain (22 lines)
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

ATOM RSS1 RSS2