🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3506

Re: Multi-level break and elimination of GOTO

#3506
From: Fredrik Bredberg
Date: Tue, 28 Nov 1995 08:51
60 lines
2727 bytes

In article <49b6ic$pvl@news.mel.aone.net.au>
andrewd@agnus.livewire.com.au (Andrew Dunbar) writes:

[snip]

> How about these new forms?
> 
> do while (expression)
> 	statement;
> 
> do while loop_name (expression)
> 	statement;
> 
> Its probably more logical than the current syntax. 

It's not clear to me (when I read this) that the statement is always
executed once. That aspect I think is much more clear in the current 

    do 
       stmt; 
    while (expr);

form.

> It is grammatically unambiguous and clean. It makes do loops easier
> to read whether they are named or not - especially for long do
> loops.  But is it worth changing the language??

No it's not!

But

    do {
       stmt;
       while (cond) {
           stmt;
           if (cond)
               break label;
           stmt;
       }
    } while label (expr);

is!

-- 
+---------------------------+------------------------------------------------+
| Fredrik Bredberg          |                                                |
| E-Mail..: frbr@enea.se    |                                                |
| Pager...: + 46 746 457371 |         Legally    - It's questionable         |
| Enea Tel: + 46 8 6385067  |         Morally    - It's disgusting           |
| Enea Fax: + 46 8 6385050  |         Personally - I like it!                |
| EUA User: konfrbr         |                                                |
| EUA  Tel: + 46 8 7273638  |                                                |
+---------------------------+------------------------------------------------+
|   o       a     Do bear in mind  that the opinions expressed  in this mail |
|   H-+-- \/#\    are my own and that they don not necessarily represent the |
|  / )      |\    opinions of my  employer or any of my  employer's clients. |
+----------------------------------------------------------------------------+
Technical Details
Message-ID: <rnb3fb9ceap.fsf@euax7i3c01.eua.ericsson.se>
Path: arc1-ca.pugleaf.net!eua.ericsson.se!usenet
References: <486cj7$o4s@news.mel.aone.net.au> <48bpa2$lmf@news.mel.aone.net.au> <m0tFpAH-000FeXC@eyrie.demon.co.uk> <490b59$3qt@panix.com> <491cb0$7dp@spool.cs.wisc.edu> <6495326.71820.1619@kcbbs.gen.nz> <49b6ic$pvl@news.mel.aone.net.au>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!eua.ericsson.se!usenet
From: konfrbr@euax7i3c01.eua.ericsson.se (Fredrik Bredberg)
Newsgroups: comp.std.c,comp.lang.c
Subject: Re: Multi-level break and elimination of GOTO
Date: 28 Nov 1995 09:51:42 +0100
Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden
Sender: konfrbr@euax7i3c01.eua.ericsson.se
Message-ID: <rnb3fb9ceap.fsf@euax7i3c01.eua.ericsson.se>
References: <486cj7$o4s@news.mel.aone.net.au>
 <48bpa2$lmf@news.mel.aone.net.au> <m0tFpAH-000FeXC@eyrie.demon.co.uk>
 <490b59$3qt@panix.com> <491cb0$7dp@spool.cs.wisc.edu>
 <6495326.71820.1619@kcbbs.gen.nz> <49b6ic$pvl@news.mel.aone.net.au>
NNTP-Posting-Host: euax7i3c01.eua.ericsson.se
In-reply-to: andrewd@agnus.livewire.com.au's message of 27 Nov 1995 02:08:12 GMT
X-Newsreader: Gnus v5.0.4