comp.lang.ada
 help / color / mirror / Atom feed
* Re: How to implement a continue statement in Ada?
@ 2000-02-08  0:00 Oliver Kellogg
  2000-02-08  0:00 ` David Starner
  2000-02-08  0:00 ` Ted Dennison
  0 siblings, 2 replies; 25+ messages in thread
From: Oliver Kellogg @ 2000-02-08  0:00 UTC (permalink / raw)


In article <6smb7v$j39$1@nnrp1.dejanews.com>,
  dennison@telepath.com wrote:

> I have used Ada for 9 years now, and have yet to tell myself,
> "gee, I really wish I could do a continue". I think this is
> mostly an issue for C converts.

I care to disagree.

We have a coding rule that forbids the use of goto.
I generally like that rule - it prevents insufficiently
trained people from messing around.

Then again, I have never needed goto for other than
emulating "continue". So I see this as an exceptional case.

I hereby cast my vote for introducing the "continue"
keyword in Ada-0x

Oliver M. Kellogg


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 25+ messages in thread
* How to implement a continue statement in Ada?
@ 1998-08-31  0:00 Robert T. Sagris
  1998-09-01  0:00 ` dewarr
  1998-09-01  0:00 ` Dr Richard A. O'Keefe
  0 siblings, 2 replies; 25+ messages in thread
From: Robert T. Sagris @ 1998-08-31  0:00 UTC (permalink / raw)


I was wondering if there is a general way of implementing 
the behavior of C's continue statement in Ada.

If at all possible without using a goto statement.

Basically what I am asking:

Is there a way to skip the current iteration of a loop
but continue with the normal progression of the loop.

In C, I could write:

   i = 0;
   while (i < 10) {

      if (a[i] == 0) {
         i++;
         continue;
      }

      a[i] = x / a[i];
      i++;
   }

Thanks for any information you can give me.

Robbi Sagris




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

end of thread, other threads:[~2000-02-14  0:00 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <35EA8153.7BFC91E3@physics.purdue.edu>
1998-08-31  0:00 ` How to implement a continue statement in Ada? Robert I. Eachus
1998-08-31  0:00   ` Robert T. Sagris
1998-09-01  0:00     ` Matthew Heaney
1998-08-31  0:00 ` Norman H. Cohen
1998-09-01  0:00 ` alan walkington
1998-09-02  0:00   ` Dr Richard A. O'Keefe
1998-09-02  0:00     ` alan walkington
1998-09-02  0:00     ` Matthew Heaney
1998-09-03  0:00     ` dewarr
2000-02-08  0:00 Oliver Kellogg
2000-02-08  0:00 ` David Starner
2000-02-08  0:00   ` Aidan Skinner
2000-02-09  0:00     ` Ted Dennison
2000-02-12  0:00       ` Jeff Carter
2000-02-14  0:00       ` Oliver Kellogg
2000-02-09  0:00     ` David Starner
2000-02-10  0:00       ` Aidan Skinner
2000-02-08  0:00 ` Ted Dennison
2000-02-09  0:00   ` Roger Barnett
  -- strict thread matches above, loose matches on Subject: below --
1998-08-31  0:00 Robert T. Sagris
1998-09-01  0:00 ` dewarr
1998-09-01  0:00 ` Dr Richard A. O'Keefe
1998-09-01  0:00   ` dewarr
1998-09-03  0:00     ` Dr Richard A. O'Keefe
1998-09-03  0:00       ` dennison

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