TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

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

Print Reply
Sender:
"Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
Date:
Thu, 23 Aug 2001 10:13:13 +0200
Reply-To:
Jean-Pierre Rosen <[log in to unmask]>
Subject:
MIME-Version:
1.0
Content-Transfer-Encoding:
7bit
Content-Type:
text/plain; charset="iso-2022-jp"
Organization:
Adalog
From:
Jean-Pierre Rosen <[log in to unmask]>
Parts/Attachments:
text/plain (25 lines)
From: "Toshitaka KUMANO" <[log in to unmask]>
> As for discrete_subtype_definition, the iteration scheme
>
>   for D in Some_Decrete_Type range Left .. Right loop
>     sequence_of_statements
>   end loop;
>
> is equivalent to
>
>   declare
>      D : Some_Decrete_Type := Left;
>   begin
>      while D <= Right loop
>          sequence_of_statements
>          D := Some_Decrete_Type'Succ (D);
>      end loop;
>   end;
>
FYI: this equivalence is wrong, a for loop is never equivalent to a while loop (unlike what C people think).
Hint: look at what happens when D=Some_Discrete_Type'Last

---------------------------------------------------------
           J-P. Rosen ([log in to unmask])
Visit Adalog's web site at http://www.adalog.fr

ATOM RSS1 RSS2