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,2cb6c27047140e0 X-Google-Attributes: gid103376,public From: "alan walkington" Subject: Re: How to implement a continue statement in Ada? Date: 1998/09/02 Message-ID: <6sk4sj$9uj$1@usenet43.supernews.com>#1/1 X-Deja-AN: 387219402 References: <35EA8153.7BFC91E3@physics.purdue.edu> <6shvd4$5v9$1@usenet46.supernews.com> <35ECD5FD.5F53@atlas.otago.ac.nz> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: newsabuse@supernews.com X-Trace: 904763091 YVH4RINSWA821D118 usenet43.supernews.com Organization: http://www.supernews.com, The World's Usenet: Discussions Start Here Newsgroups: comp.lang.ada Date: 1998-09-02T00:00:00+00:00 List-Id: Dr Richard A. O'Keefe wrote in message <35ECD5FD.5F53@atlas.otago.ac.nz>... >alan walkington wrote: >> >> Robert T. Sagris wrote in message <35EA8153.7BFC91E3@physics.purdue.edu>... >> >I was wondering if there is a general way of implementing >> >the behavior of C's continue statement in Ada. >> >> As you have seen from the responses, the answer is NO. > >Clearly I have missed some responses. IMHO the original poster was looking for an atomic ada construct similar to the 'continue' statement in C. We, including myself, responded with 'work-arounds' that achieved the same thing. >What exactly is wrong with > - Robert Dewar's suggestion of using 'goto', or Some of us who write Ada for the US government are stuck with coding standards which prohibit the use of 'goto' under any circumstance. Not good CS, but we have to learn to live with it. > - my suggestion of using a nested named block and named exits? I don't know how to use the 'exit' statement to get out of a block. Elucidate, dear doctor? >Both suggestions "implement the behaviour", which is skipping the >rest of the body of the loop. Yes, that's also what my psuedo code does. >Is it the fact that you have to invent names, >which you do not in C? >Is it the fact that these translations are _too_ powerful, >handling multi-level exit, which the C version does not? Please lets not get into a 'which language is better' mode. I've been using Ada for almost 15 years now, and C for longer. Both Ada and C/C++ have there uses. Alan Walkington Sr. Software Engineer UDLP, San Jose (remove the obvious from the e-mail address) walkyANTISPAM@netmagic.net