comp.lang.ada
 help / color / mirror / Atom feed
From: sparre@meyer.fys.ku.dk (Jacob Sparre Andersen)
Subject: loop and block question
Date: 1997/01/29
Date: 1997-01-29T00:00:00+00:00	[thread overview]
Message-ID: <1997Jan29.171423.3481@news.nbi.dk> (raw)


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
--  
------------------------------------------------------------------------------




             reply	other threads:[~1997-01-29  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-29  0:00 Jacob Sparre Andersen [this message]
1997-01-29  0:00 ` loop and block question Robert A Duff
1997-01-29  0:00 ` Steve Jones - JON
1997-01-29  0:00   ` Robert A Duff
     [not found]   ` <E4wHKC.FB5@thomsoft.com>
     [not found]     ` <32F3D3BA.4B88@ssf.fi>
     [not found]       ` <E4yCBo.FrC@world.std.com>
1997-03-16  0:00         ` Niklas Holsti
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox