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,99e73f65ea2533b9 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news-fra1.dfn.de!news-lei1.dfn.de!news.uni-weimar.de!not-for-mail From: stefan-lucks@see-the.signature Newsgroups: comp.lang.ada Subject: Re: and then... (a curiosity) Date: Thu, 4 Sep 2008 21:43:40 +0200 Organization: Bauhaus-Universitaet Weimar Message-ID: References: <18b41828-bda4-4484-8884-ad62ce1c831d@f36g2000hsa.googlegroups.com> <57qdnfULQ9tzKCHVnZ2dnUVZ_tHinZ2d@comcast.com> <48bd0003$1@news.post.ch> <48bf90bf$0$30032$dbd4d001@news.euronet.nl> <48bffbb7$0$74166$dbd49001@news.euronet.nl> Reply-To: stefan-lucks@see-the.signature NNTP-Posting-Host: medsec1.medien.uni-weimar.de Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: tigger.scc.uni-weimar.de 1220553108 4557 141.54.178.228 (4 Sep 2008 18:31:48 GMT) X-Complaints-To: news@tigger.scc.uni-weimar.de NNTP-Posting-Date: Thu, 4 Sep 2008 18:31:48 +0000 (UTC) X-X-Sender: lucks@medsec1.medien.uni-weimar.de In-Reply-To: Xref: g2news2.google.com comp.lang.ada:7650 Date: 2008-09-04T21:43:40+02:00 List-Id: On Thu, 4 Sep 2008, stefan-lucks@see-the.signature wrote: > On Thu, 4 Sep 2008, wrote: > > So if I understand you correctly this time, the raising (or not) of an > > exception for "if Y/X<000" should in your view depend on the context where > > it is used: [...] > > No, you misread me again. If you had read some earlier posts from me in > this thread, what I am trying to express is that "and" should better do > what "and then" actually does. That is it, so simple! To be precise, here is a cut-and-paste from what I wrote in another posting: 1. If the A- or the B-part in "if A and B" raises an exception, but the other part is false, the "right thing" (TM) to do would be to transfer control to the else clause (or below "end if", when there is no else). The intermediate result can be viewed as a three-valued logic expression, but the final outcome of the Boolean expression must be Boolean, of course. 2. If both raise A and B an exception, of if one raises an exception and the other one is true, an exception is propagated. 3. I would be willing to pragmatically sacrifice mathematical purity for a shortcut rule: If A is false, the expression is false, whatever B does. If A raises an exception, of if A is true and B raises an exception, the exception is propagated. 1. and 2. describe some "ideal" behaviour, but 3. describes what the one can realistically expect from the compiler. BTW, the compiler would not need to be that incredibly smart. If an exception is raised when evaluating a Boolean expression, the exception could be handled inernally, to finish evaluating the Boolean expression, and re-raised if neccessary. -- ------ Stefan Lucks -- Bauhaus-University Weimar -- Germany ------ Stefan dot Lucks at uni minus weimar dot de ------ I love the taste of Cryptanalysis in the morning! ------