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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Building an encapsulated library that uses GNAT sockets under Windows Date: Wed, 27 Apr 2016 17:16:06 -0500 Organization: JSA Research & Innovation Message-ID: References: <58a4942a-452a-4f32-b39b-f8f1fdbfe9fb@googlegroups.com> <68353b5d-94dc-4604-bdb1-00b48396ec1b@googlegroups.com> <33e880a1-df5f-450c-89e0-9b1d1a95e12f@googlegroups.com> <6c3cb21b-f729-4599-afb0-793c8b8fc2b8@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1461795366 19000 24.196.82.226 (27 Apr 2016 22:16:06 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 27 Apr 2016 22:16:06 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:30306 Date: 2016-04-27T17:16:06-05:00 List-Id: wrote in message news:cf442cc4-8123-4815-8b49-ce1411ff4ed0@googlegroups.com... ... > In the late seventies we were taught that gotos were evil and never > to be used yet here they are, three and a half decades later, still using > them - what a disgrace - have people no shame? ;-) I hope the smiley face applies to the entire rant about Gotos. When we discussed whether Ada should have a loop continue statement, the conclusion was that goto is good enough for such cases. They aren't common enough to justify adding a new kind of statement, especially one that can get lost (some people dislike deeply nested return statements, and "continue" would be worse). We even changed the syntax slightly to make it legal for a label to be the last thing in a sequence of statements. That is: loop {some code} if something then goto Continue; end if; {more code} <> -- Ada 95 requires "null;" here, Ada 2012 does not. end loop; See AI05-0179-1 for details. To completely eliminate the goto, one has to use a Boolean variable instead, or duplicate parts of the loop; both of those obscure what is going on more than the goto. Moral: all gotos aren't bad. Coding standards that reject them out of hand are just like coding standards that reject exception handling or finalization out of hand -- deeply flawed. Randy.