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,e646052dc594401f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Strategies with SPARK which does not support exceptions Date: Thu, 17 Jun 2010 20:19:04 +0200 Organization: Ada At Home Message-ID: References: NNTP-Posting-Host: Ytbm1wnfaYrLLNPp/2uoww.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.53 (Win32) Xref: g2news1.google.com comp.lang.ada:11803 Date: 2010-06-17T20:19:04+02:00 List-Id: Le Thu, 17 Jun 2010 19:11:29 +0200, Warren a =C3=A9cr= it: > It is often not sufficient to simply know that OK is false. > For example, wouldn't it be nice for the user to know that > the open failed because of permissions, instead of the file > not existing. > > Warren Hillo Warren I see what you mean (I like the C analogy for this, that is meaningful),= = while I don't fully agree with this later point : an exception typically= = do not holds such details. The exception says =E2=80=9CIf fails=E2=80=9D= , and don't say = why (or just sightly, via its ID). Don't confuse Ada exception mechanism= = with other OO exception mechanisms, which comes with many and too much = (because unusable in real life) members to hold informations about the = exception occurence. By the way, you are talking about propagated exceptions (as you talked = about callers). I did not already set up a strategy for this. The way I = = was talking about just applies to exception raised and caught inside the= = same subprogram. I suppose this way could be extended to propagated = exceptions, but I'm afraid of bloating doing so. I though about somethin= g = looking like =E2=80=9Csoftware register=E2=80=9D (analogy with CPU statu= s registers), but = I'm afraid this may not be safe (while luckily, SPARK can help a lot to = = properly use global variables ;) ). Have a nice day -- = There is even better than a pragma Assert: a SPARK --# check. --# check C and WhoKnowWhat and YouKnowWho; --# assert Ada; -- i.e. forget about previous premises which leads to conclusion -- and start with new conclusion as premise.