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: g2news1.google.com!news4.google.com!goblin2!goblin.stu.neva.ru!newsfeed.velia.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: Sun, 7 Sep 2008 18:45:54 +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> <12prmxev8newf.lvc4m055okkb$.dlg@40tude.net> <118b62boky4l7.4par5acnu8os$.dlg@40tude.net> 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 1220801647 18669 141.54.178.228 (7 Sep 2008 15:34:07 GMT) X-Complaints-To: news@tigger.scc.uni-weimar.de NNTP-Posting-Date: Sun, 7 Sep 2008 15:34:07 +0000 (UTC) X-X-Sender: lucks@medsec1.medien.uni-weimar.de In-Reply-To: <118b62boky4l7.4par5acnu8os$.dlg@40tude.net> Xref: g2news1.google.com comp.lang.ada:1955 Date: 2008-09-07T18:45:54+02:00 List-Id: On Fri, 5 Sep 2008, Dmitry A. Kazakov wrote: > On Fri, 05 Sep 2008 10:14:47 -0400, Robert A Duff wrote: > > > Some more questions about 3. > > (The proposal is, as I understood it, IMO workable, but it potentially has > a heavy overhead and it does not solve the problem. It is not the > mathematical interpretation of "and", and its semantics is not better than > one of "and then". Further IMO the problem lies elsewhere. Nevertheless, I > will take the liberty of explaining the semantics, and consequences) Once again, I didn't actually *propose* anything. But you described some ideas I had very well, Dmitry, thank you. > No, all arguments are eagerly evaluated. It is simply so that exception > becomes a legal value of "Universal_Boolean". The exception is raised when > such value is converted to Boolean in the context where a Boolean is > expected. Like in "if". But "and", "or", "xor", "not" operate on > "Universal_Boolean". I would consider both the option of introducing lazy evaluation (not as a special "compiler magic" thing only for "and", but in general), or extending the type Boolean, as described by you. > (I hope Stefan will correct me if I misinterpreted his proposal) No problem! You expressed one of the ideas I had in my mind better than I would have done it myself. But once again, I didn't make a proposal. I just shared some thoughts about the non-shortcut-and (and -or) in "if" expressions, which in my experience is a common error-pattern in Ada. (Other languages have more and worse traps than Ada, but nevertheless ...) -- ------ Stefan Lucks -- Bauhaus-University Weimar -- Germany ------ Stefan dot Lucks at uni minus weimar dot de ------ I love the taste of Cryptanalysis in the morning! ------