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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7d3cb5920e882220 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!newsfeed101.telia.com!nf02.dk.telia.net!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsinpeer00.lnd.ops.eu.uu.net!emea.uu.net!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Exceptions Date: Fri, 07 Dec 2007 18:59:41 +0000 Organization: Pushface Message-ID: References: <5947aa62-2547-4fbb-bc46-1111b4a0dcc9@x69g2000hsx.googlegroups.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1197053980 21802 62.49.19.209 (7 Dec 2007 18:59:40 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Fri, 7 Dec 2007 18:59:40 +0000 (UTC) Cancel-Lock: sha1:akUeNp1jaNFk89j4VW8sD5EfguA= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin) Xref: g2news1.google.com comp.lang.ada:18769 Date: 2007-12-07T18:59:41+00:00 List-Id: Adam Beneschan writes: > On Dec 6, 7:00 am, shaunpatter...@gmail.com wrote: >> Is there any way to force programmers to catch exception that >> your function throws? > > Not in Ada. If you're looking for, say, a pragma that you can put > on a subprogram declaration to tell the compiler to reject any code > that calls the subprogram in a place not governed by an exception > handler for a specified exception---that's an interesting idea, and > maybe if there's enough interest it could be added to a future > revision of Ada, probably Annex H. I don't see any problem with a > particular compiler vendor implementing a pragma like that, though, > although of course it would be non-portable; perhaps you could ask > your vendor if they'd be willing to implement something like that. > It would probably not be too difficult to implement. I think this would be a very bad idea. I don't want to be forced to deal with the exception 'here' when it would be better handled by my caller. I suppose we could have 'pragma Propagates' but it seems like a lot of work for little gain (what _is_ the gain?) --S