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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,699cc914522aa7c4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon02.news.prodigy.net!prodigy.net!newspeer.monmouth.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!news0.de.colt.net!news-fra1.dfn.de!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Structured exception information Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Fri, 19 Jan 2007 12:03:13 +0100 Message-ID: <5e0owbs5cgtv$.kyfgnvskadxd.dlg@40tude.net> NNTP-Posting-Date: 19 Jan 2007 12:03:13 CET NNTP-Posting-Host: f32e3023.newsspool4.arcor-online.net X-Trace: DXC=mVI3B9G=f`AE4ZB2flKORA4IUKkgBmmD0Wj]aJ1N X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:8323 Date: 2007-01-19T12:03:13+01:00 List-Id: On Fri, 19 Jan 2007 04:47:28 -0500, Stephen Leake wrote: > Maciej Sobczak writes: > >> Doesn't feel as type-safe as advertised. > > But you have not given an actual example where a string is not > a type-safe solution to the actual problem at hand. > > The only example you have given is "present the error to the user". In > that case, a string is precisely the correct type. What about presenting an information necessary for handling the exception to the handler? Normally, exceptions are used when the situation cannot be dealt at the point of raising. It cannot be handled because of lack of information. For instance, Read has no idea what to do on EOF. But the handler of End_Error knows it. Fine. Now consider, a more complex picture. Let the client knows something. It is still not enough, but it is a necessary piece of the puzzle, and what is more important, is that the handler does not have this information and cannot reconstruct it. In this scenario you would like to pass it as a parameter to the handler, in an type-safe way, an Ada way. As a practical example, consider mail non-delivery. A returned mail plus traceback is the information to you, the handler from the exception point. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de