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,99e73f65ea2533b9 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news3.google.com!out02b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!in03.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!fe089.usenetserver.com.POSTED!4a71828c!not-for-mail From: Hyman Rosen User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: and then... (a curiosity) References: <18b41828-bda4-4484-8884-ad62ce1c831d@f36g2000hsa.googlegroups.com> <57qdnfULQ9tzKCHVnZ2dnUVZ_tHinZ2d@comcast.com> <48bd0003$1@news.post.ch> <12prmxev8newf.lvc4m055okkb$.dlg@40tude.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@WWWSpace.NET NNTP-Posting-Date: Fri, 05 Sep 2008 11:15:00 EDT Date: Fri, 05 Sep 2008 11:14:59 -0400 Xref: g2news1.google.com comp.lang.ada:1948 Date: 2008-09-05T11:14:59-04:00 List-Id: Robert A Duff wrote: > I'm just trying to explore the consequences of this seemingly-simple > language design choice. It doesn't seem so simple to me. There are two kinds of "and" - the one that's involved in control flow, and should therefore be short-circuited, and the one that combines booleans, which is just an arithmetic function like addition and should therefore not be short- circuited. Both C and Ada have this, C through "&&" and "&" and Ada through "and then" and "and". Given the nature of code, the control flow variant appears far more often than the arithmetic one, so I guess some people are disturbed by the fact that the most common variant is wordier. As a long-time reader of this newsgroup, I know the mantra that "Ada is designed for readers, not writers. Shorter is not necessarily better." :-) By the way, C++ made the design mistake of allowing && and || to be overloaded, whereupon they lose their short-circuit behavior and become normal evaluate-both-operands functions. Just awful.