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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9c3095e7116890a3,start X-Google-Attributes: gid103376,public From: sparre@meyer.fys.ku.dk (Jacob Sparre Andersen) Subject: loop and block question Date: 1997/01/29 Message-ID: <1997Jan29.171423.3481@news.nbi.dk>#1/1 X-Deja-AN: 213010168 keywords: Ada, loop statement itentifier, block statement, GNAT newsgroups: comp.lang.ada Date: 1997-01-29T00:00:00+00:00 List-Id: GNAT will not compile the inserted procedure, where I, in two different block statements, declare two loops with the same loop statement identifier. Is that because a) loop statement identifiers are globally known? b) identifiers declared within a block statement are globally known? c) that's how it is? d) GNAT has an annoying feature? I have read sections 5.5 (Loop Statements) and 5.6 (Block Statements), but they didn't make me much wiser. Greetings, Jacob ... Jacob Sparre Andersen http://www.nbi.dk/%7Esparre/ Center for Chaos and Turbulence Studies Phone: (+45) 39 65 53 51 The Niels Bohr Institute (+45) 35 32 53 05 ... LEGO: MOC+++c TO+++(6543) TC+++(8880) AQ+++ BV-- #++ S LS++ A-/+ YB72m ------------------------------------------------------------------------------ -- The example: procedure Two_Loops is begin Block_1: begin Some_Loop_Name: for Index in 1 .. 10 loop null; end loop Some_Loop_Name; end Block_1; Block_2: begin Some_Loop_Name: for Index in 1 .. 10 loop null; end loop Some_Loop_Name; end Block_2; end Two_Loops; ------------------------------------------------------------------------------ -- Error messages from GNAT: -- -- GNAT 3.05 (960607) Copyright 1991-1996 Free Software Foundation, Inc. -- -- Compiling: two_loops.adb (source file time stamp: 1997-01-28 11:02:36) -- -- 8. Some_Loop_Name: -- | -- >>> "Some_Loop_Name" conflicts with label at line 18 -- -- 17. Some_Loop_Name: -- | -- >>> "Some_Loop_Name" conflicts with label at line 9 -- -- 22 lines: 2 errors -- ------------------------------------------------------------------------------