From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!pBWEO6hi52oGFheO/GY5ag.user.gioia.aioe.org.POSTED!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Ada and "early return" - opinion/practice question Date: Tue, 16 Mar 2021 02:16:24 -0700 Organization: Aioe.org NNTP Server Message-ID: <861rcfe9w7.fsf@stephe-leake.org> References: <38356aa9-b8b0-4e0b-a490-99e7b239d0b1n@googlegroups.com> <87im5sutdt.fsf@nightsong.com> NNTP-Posting-Host: pBWEO6hi52oGFheO/GY5ag.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:I0axGFvdqpZ74xF15QjA+SpblcU= Xref: reader02.eternal-september.org comp.lang.ada:61551 List-Id: Paul Rubin writes: > Shark8 writes: >> Exceptions, typically. Sometimes a return itself, typically in a >> procedure though. > > This is interesting: I thought in the Java and C++ worlds, using > exceptions to manage normal control flow was frowned on, in part because > the exception mechanism is quite heavyweight. And in Haskell, > exceptions are considered i/o effects and therefore nasty in pure code > (code with side effects is "impure" and has a special type signature). > > Is there wisdom about this in Ada? GNAT has zero-cost exceptions; raising an exception is the same as goto. -- -- Stephe