comp.lang.ada
 help / color / mirror / Atom feed
* loop and block question
@ 1997-01-29  0:00 Jacob Sparre Andersen
  1997-01-29  0:00 ` Steve Jones - JON
  1997-01-29  0:00 ` Robert A Duff
  0 siblings, 2 replies; 5+ messages in thread
From: Jacob Sparre Andersen @ 1997-01-29  0:00 UTC (permalink / 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
--  
------------------------------------------------------------------------------




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1997-03-16  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-01-29  0:00 loop and block question Jacob Sparre Andersen
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
1997-01-29  0:00 ` Robert A Duff

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