From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5749 invoked from network); 1 Dec 2020 20:50:27 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 1 Dec 2020 20:50:27 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 9D5D294919; Wed, 2 Dec 2020 06:50:26 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 5655D94904; Wed, 2 Dec 2020 06:50:05 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=ccil-org.20150623.gappssmtp.com header.i=@ccil-org.20150623.gappssmtp.com header.b="hdnXgAMH"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id C4C7094904; Wed, 2 Dec 2020 06:50:03 +1000 (AEST) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by minnie.tuhs.org (Postfix) with ESMTPS id CC95994843 for ; Wed, 2 Dec 2020 06:50:02 +1000 (AEST) Received: by mail-io1-f48.google.com with SMTP id q137so3060049iod.9 for ; Tue, 01 Dec 2020 12:50:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xEY5kaR8RQH8fD9cRUDW5cY3/S/dx0idMg6SaupoZZY=; b=hdnXgAMHn4f5VxULIcYJOf/wEC20Dd4YeJGf/LTClTVLiP5EgBLC9u5B2EN21tt3N6 mcFBjizJQL98felOnxAyj3TDvuteDXuMrP2XCLqiu10YEzAx0kVcY+cB/3jSELLFC4k6 uLEmaIGRZgpcDkMZtwKwSK9COk6SJhOukQ/9YgEi9acmL7TxbkogqZA3J8dbrrLyD5Wj Si12/+Y4lBUFqmMxF0IYR52h0Uf2jOw+wBaq37X3lEQoAHhkPf5cdTO54VchVaooApMH MDBHm8j0AV+/8xd1uq7uTlDSvHH8TwN269ak6sBOn/t44zdvZGcfhySSymeFeNwJU4LX EIUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xEY5kaR8RQH8fD9cRUDW5cY3/S/dx0idMg6SaupoZZY=; b=KEK58HV2Wr+KFO5XHfFB+7b8azlz8IXQkvIq4sCla4o6V1ik1iGURvsMOvkb0yyQns WzznbHiH2lf5i/Uoh1i/H9MjZPq0Rnuxa9x6wSv+b0/hue0NTeM1hz8jm8G+rFpBlckX GDLOW3JHDqPDzXUG7//w5b4kbfB3DwlmCdE4ZN9ndbuvualAe8gDqozD+ql85KHiTFhi QDFCfshkpi0x4u6sWdMoQ9EUN3EkiCp8VPk5Vmt4gg4kHv2XXEptHN0kHs7A9g5BtkZf okK4/Gj3wJ6tGljtSswdrxg0byUNgVkWT3+Srjs8InBnHc3TDYIfsdbzun3X6lNx09d6 S5ow== X-Gm-Message-State: AOAM533KdkGjwFdSoRy7ibbJpErFDhPnCN4u+SctMHbal0DrV/oeNZ63 5jDVTrenvYo812Oe/A2y+AQBl0Xxa7Vll0WAt0X1TO6TZS6CVB8F X-Google-Smtp-Source: ABdhPJwj1e6eoQNS0x+lZ1xYovlwNCOM1QwkAM0c45ybPJ1KLY+x9UxJJIdEkRQ25wFW27ts1WjzRvLlnmkO7ygGE6s= X-Received: by 2002:a02:c608:: with SMTP id i8mr4332944jan.125.1606855801887; Tue, 01 Dec 2020 12:50:01 -0800 (PST) MIME-Version: 1.0 References: <15511090.6330.1606835354160.JavaMail.root@zimbraanteil> In-Reply-To: From: John Cowan Date: Tue, 1 Dec 2020 15:49:50 -0500 Message-ID: To: Dave Horsfall Content-Type: multipart/alternative; boundary="00000000000046f84305b56d4570" Subject: Re: [TUHS] The UNIX Command Language (1976) X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --00000000000046f84305b56d4570 Content-Type: text/plain; charset="UTF-8" On Tue, Dec 1, 2020 at 3:14 PM Dave Horsfall wrote: > And then there was the story of Professor Goto (a Japanese citizen and > computer bod) who complained that everyone was trying to eliminate him :-) > But cheerfully so, according to Knuth. He is also known for the invention of hash consing. Knuth's article "Structured programming with goto statements" is a great discussion of all the reasons you'd want to use goto in languages with just conditionals and while loops: error exits, jumping out of nested tests, jumping out of a nest of conditionals and break/continue (both essentially kinds of static catch tags), loops iterated n-and-a-half-times (break will do this, but it's over-powered), tail recursion, "encoding boolean variables in the program counter", coroutines. There are also such things as fast linear search by putting the searched-for value at the end of the array being searched, and what boils down to Lisp macros ("allowing an optimizing compiler to express its optimizations in the source language"). On Tue, Dec 1, 2020 at 3:39 PM Bakul Shah wrote: > But I have mixed feelings about goto vs continue/break. A nested > loop with multiple continue/break can be as obscure. I think if the loops are labeled rather than the destinations, and you use "next foo" instead of "continue" and "last foo" instead of "break", it's all quite readable. John Cowan http://vrici.lojban.org/~cowan cowan@ccil.org Sir, I quite agree with you, but what are we two against so many? --George Bernard Shaw, to a man booing at the opening of _Arms and the Man_ --00000000000046f84305b56d4570 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Dec 1, 20= 20 at 3:14 PM Dave Horsfall <dave@h= orsfall.org> wrote:
=C2=A0
And then there was the story of Professor Goto = (a Japanese citizen and
computer bod) who complained that everyone was trying to eliminate him :-)<= br>

But cheerfully so,= according to Knuth.=C2=A0 He is also known for the invention of hash consi= ng.=C2=A0 Knuth's article "Structured programming with goto statem= ents" <http://www.clifford.at/cfun/cliffdev/p261-knuth.pdf> is a great = discussion of all the reasons you'd want to use goto in languages with = just conditionals and while loops:=C2=A0 error exits, jumping out of nested= tests, jumping out of a nest of conditionals and break/continue (both esse= ntially kinds of static catch tags), loops iterated n-and-a-half-times (bre= ak will do this, but it's over-powered), tail recursion, "encoding= boolean variables in the program counter", coroutines.=C2=A0 There ar= e also such things as fast linear search by putting the searched-for value = at the end of the array being searched, and what boils down to Lisp macros = ("allowing an optimizing compiler to express its optimizations in the = source language").

On Tue, Dec 1, 2020 a= t 3:39 PM Bakul Shah <bakul@iitbo= mbay.org> wrote:
=C2=A0
But I have mixed feelings about goto vs continue/break. A nested
loop with multiple continue/break can be as obscure.

<= /div>
I think if the loops are labeled rather than the destinations, an= d you use "next foo" instead of "continue" and "la= st foo" instead of "break", it's all quite readable.=C2= =A0



=
John Cowan =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0http://vrici.lojban.org/~cowa= n =C2=A0 =C2=A0 =C2=A0 =C2=A0cowan@cc= il.org
Sir, I quite agree with you, but what are we two against so m= any?
=C2=A0 =C2=A0 --George Bernard Shaw,
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0to a man booing at the opening of _Arms and the Man_

--00000000000046f84305b56d4570--