From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!uw-june!pattis From: pattis@june.cs.washington.edu (Richard Pattis) Newsgroups: comp.lang.ada Subject: FOR Iteration Scheme Keywords: semantics, translation Message-ID: <5320@june.cs.washington.edu> Date: 18 Jul 88 20:15:33 GMT Organization: U of Washington, Computer Science, Seattle List-Id: In the process of writing a CS-1 book that uses Ada as its langauge of discourse, I am trying to describe formally the semantics of the FOR iteration scheme using other parts of Ada (whose semantics I explain operationally). Is the following the most accurate statement I can make? CAUTION: I am in the process of learning Ada (trying to compose such explanations helps me), so this may be a naive question. FOR I IN E1..E2 LOOP END LOOP; is equivalent to the following code fragment, where the values of E1 and E2 share subtype and and are secret objects generated by the Ada compiler. DECLARE : := E1; : CONSTANT := E2; BEGIN IF <= THEN LOOP DECLARE I : CONSTANT := ; BEGIN END; EXIT WHEN = ; := 'SUCC(); END LOOP; END IF; END;