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,b3f788f59498d3af X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 20 Jun 2007 08:16:37 +0200 From: Georg Bauhaus Organization: # User-Agent: Thunderbird 1.5.0.12 (Macintosh/20070509) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Exceptions and out procedure arguments (using GNAT GPL) References: <79c673pq5htg508nkoi935n3udqg5ps7r8@4ax.com> <1182181497.595409.300500@a26g2000pre.googlegroups.com> <1182238493.512406.168820@o61g2000hsh.googlegroups.com> <1182266486.650797.262430@a26g2000pre.googlegroups.com> <1182288056.091791.248430@n15g2000prd.googlegroups.com> In-Reply-To: <1182288056.091791.248430@n15g2000prd.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4678c589$0$23147$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Date: 20 Jun 2007 08:13:29 CEST NNTP-Posting-Host: e34ba72d.newsspool1.arcor-online.net X-Trace: DXC==dIobnMOgOA=8m7nZkdN^@ic==]BZ:afN4Fo<]lROoRAFl8W>\BH3YBDS4AhY:H>IGA:ho7QcPOVCB;>\h05OfF@73gm69V[7^H X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:16251 Date: 2007-06-20T08:13:29+02:00 List-Id: Adam Beneschan wrote: > > I'd object to is, say, a procedure that reads a string from a file > into an OUT parameter, and then raises an exception if the string > doesn't conform to some syntax. Then, from the caller's point of > view, the procedure can *both* return valid (although inferior) output > *and* raise an exception, which I think would make things difficult to > understand for someone trying to read the code that calls the > procedure The Design by Contract point of view :-) I.e., you do not use assertions (and hence exceptions) for handling invalid input; instead, you use an if statement, or whatever seems equivalent. -- Georg