comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Labeled exit within generalized labeled loop not allowed?
Date: Thu, 19 Jul 2012 01:41:00 -0500
Date: 2012-07-19T01:41:00-05:00	[thread overview]
Message-ID: <ju8a60$6jj$1@munin.nbi.dk> (raw)
In-Reply-To: a6ie8cFfi4U1@mid.individual.net

"Niklas Holsti" <niklas.holsti@tidorum.invalid> wrote in message 
news:a6ie8cFfi4U1@mid.individual.net...
...
> The conclusion is that I (as one example of an Ada programmer) usually 
> would not code an exit statement (whether labeled or unlabeled) in a 
> simple loop that uses the generalized loop syntax, because then the loop 
> would not process all the elements in the container.

The AARM specifically suggests using an exit statement if you need to just 
handle part of a container. See A.18.2(230.a-c/3).

That's the justification for why there is an iterator form that has a start 
location, but no iterator with a stop location. (Beyond the fact that there 
are problems if the stop location is not in the container.)

So it is intended that such exits be used. I'd expect the need to be 
relatively rare, but certainly not non-existent.

                              Randy.





      parent reply	other threads:[~2012-07-25  3:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-13 16:19 Labeled exit within generalized labeled loop not allowed? Marc C
2012-07-13 17:21 ` Thomas Løcke
2012-07-16  9:33 ` Thomas Løcke
2012-07-16 10:33   ` Niklas Holsti
2012-07-16 12:03     ` Niklas Holsti
2012-07-16 12:29       ` Thomas Løcke
2012-07-16 15:24         ` Marc C
2012-07-17  6:01           ` Thomas Løcke
2012-07-19  6:41       ` Randy Brukardt [this message]
replies disabled

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