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=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!postnews.google.com!s19g2000prg.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Exceptions Date: Fri, 7 Dec 2007 08:55:09 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <5947aa62-2547-4fbb-bc46-1111b4a0dcc9@x69g2000hsx.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1197046509 29267 127.0.0.1 (7 Dec 2007 16:55:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 7 Dec 2007 16:55:09 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s19g2000prg.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:18765 Date: 2007-12-07T08:55:09-08:00 List-Id: 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. -- Adam