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!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed.freenet.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: Fri, 5 Sep 2008 09:44:33 +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> <48c03fd1$0$12199$dbd4f001@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 1220596362 6459 141.54.178.228 (5 Sep 2008 06:32:42 GMT) X-Complaints-To: news@tigger.scc.uni-weimar.de NNTP-Posting-Date: Fri, 5 Sep 2008 06:32:42 +0000 (UTC) X-X-Sender: lucks@medsec1.medien.uni-weimar.de In-Reply-To: <48c03fd1$0$12199$dbd4f001@news.euronet.nl> Xref: g2news2.google.com comp.lang.ada:7663 Date: 2008-09-05T09:44:33+02:00 List-Id: On Thu, 4 Sep 2008, wrote: > > On Thu, 4 Sep 2008, stefan-lucks@see-the.signature wrote: > >> 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! [...] > I personally could life with the idea that in Ada, 'and' would have had > conditional formantics (now and-then)and some other operator would have > unconditional formantics (now and). That is just swapping tokens at the > lexical level. Fine. What is your point? That was my point. I don't know why this raised such a lengthy thread. > > 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. > > Thank you, there it is. Please don't take me out of context! As I pointed out, there are reasons not to do exactly the "right thing" in a pragmatic language. I had been very explicit, that if I where proposing a language change (I am not, as this would break compatibilty), I would propose the following: > > 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. > > Congratulations, you just reinvented the and-then in Ada. I didn't invent or re-invent anything. I just pointed out that the fact that "and then" does, what "and" should do. This is un-intiutive and error-prone. Exceptions may be raised which the programmer would not really expect to be raised. I described an "ideal" interpretation. You would not need "mind reading" capabilities to impleent it, but it would still be too heavy-weight and complex. And I pointed out an easy and pragmatic approach which could handle the issue, and which is used in quite a few other programming languages. > 1+2 may appear ideal for a mathematician, because of the symmetry it > provides. [...] > > Ideal behavior is a fata morgana from lala-land. We have to deal with > fallible developers and machinery. Thank you for making my point! -- ------ Stefan Lucks -- Bauhaus-University Weimar -- Germany ------ Stefan dot Lucks at uni minus weimar dot de ------ I love the taste of Cryptanalysis in the morning! ------