🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #889

Re: do...while vs. repeat...until (was: Errors aren't that simple)

#889
From: C.E. Thompson
Date: Fri, 16 Mar 1990 15:42
32 lines
2007 bytes
In article <16188@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes:
>In article <5819.25f7a840@vax1.tcd.ie> cbuckley@vax1.tcd.ie writes:
>>In article <Mar.7.10.43.42.1990.17402@paul.rutgers.edu>, emuleomo@paul.rutgers.edu (Emuleomo) writes:
>>> The other less serious flaw in C is the do...while contruct.
>>> I kind of prefer PASCAL's repeat....until construct myself.
>>
>>How can this be a flaw? The two constructs are identical except for the fact
>>that the condition is reversed...
>
>That's enough to make it a (minor) flaw.  Judging from my own personal
>experience, it is more natural for a test-at-top loop to specify the condition
>for continuing (while), but for a test-at-bottom loop to specify the condition
>for terminating (until).  I don't know if there's been a study on this; in
>fact, I'm not entirely sure how to formalize the concept.

Time for another BCPL-was(is)-better-than-C plug. BCPL has

      WHILE expression DO command
      UNTIL expression DO command
                          command REPEATWHILE expression
                          command REPEATUNTIL expression

and of course

                          command REPEAT       /* for ever */

But you probably wanted to use some of those reserved words as variable
names, right? :-)

Chris Thompson
JANET:    cet1@uk.ac.cam.phx
Internet: cet1%phx.cam.ac.uk@nsfnet-relay.ac.uk
Technical Details
Message-ID: <1808@gannet.cl.cam.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!mcsun!ukc!cam-cl!cet1
References: <8192@hubcap.clemson.edu> <17000003@hpcvra.CV.HP.COM> <Mar.7.10.43.42.1990.17402@paul.rutgers.edu> <5819.25f7a840@vax1.tcd.ie> <16188@haddock.ima.isc.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!mcsun!ukc!cam-cl!cet1
From: cet1@cl.cam.ac.uk (C.E. Thompson)
Newsgroups: comp.lang.misc
Subject: Re: do...while vs. repeat...until (was: Errors aren't that simple)
Message-ID: <1808@gannet.cl.cam.ac.uk>
Date: 16 Mar 90 15:42:35 GMT
References: <8192@hubcap.clemson.edu> <17000003@hpcvra.CV.HP.COM> <Mar.7.10.43.42.1990.17402@paul.rutgers.edu> <5819.25f7a840@vax1.tcd.ie> <16188@haddock.ima.isc.com>
Sender: news@cl.cam.ac.uk
Reply-To: cet1@cl.cam.ac.uk (C.E. Thompson)
Organization: U of Cambridge Comp Lab, UK
Lines: 32