TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
Jean-Pierre Rosen <[log in to unmask]>
Reply To:
Jean-Pierre Rosen <[log in to unmask]>
Date:
Thu, 23 Aug 2001 11:29:13 +0200
Content-Type:
text/plain
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