From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 31624 invoked from network); 25 Apr 2020 02:55:02 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with UTF8ESMTPZ; 25 Apr 2020 02:55:02 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id F38F79C861; Sat, 25 Apr 2020 12:54:59 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 27BF49C733; Sat, 25 Apr 2020 12:54:42 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="H7YGIy6/"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 9DFE99C733; Sat, 25 Apr 2020 12:54:40 +1000 (AEST) Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com [209.85.222.51]) by minnie.tuhs.org (Postfix) with ESMTPS id C6B3C9C171 for ; Sat, 25 Apr 2020 12:54:39 +1000 (AEST) Received: by mail-ua1-f51.google.com with SMTP id y10so11594176uao.8 for ; Fri, 24 Apr 2020 19:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kcXyKQyNgwecNTP8Ya7SuqNdSwBAW8Ypimt340M9GNM=; b=H7YGIy6/gyTf+3fNPPMA5NThYqc9F0n1V+dzri7e3BsLDoLQ6E0BTIlgdVE3X/WV2o 97vLWJh71gQbhZaqh9Gt2n61ACJNN6NV9Fbn/kyeVek3mjdyoBzw0z8vH2OMvS/doGyk yy6yVYofygg6fR5pgI9uIuI6Jrinu5wvzWwuLkpintpLOGKgz56O+6ep7lgAaBkd1Kjf zT7nR9fV8Nqo+jgIOuNcg45TgPrWMkNyxNssHAxy2WEmj9+29kpyvXg6kg+PSTcMY9DA Zb7FxDtusYZM6nk38soM2jkFsxKKdqAfmtI6OPQ2ih5DLafPQATQT9pPlLKM3vWYuul1 1/hQ== 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=kcXyKQyNgwecNTP8Ya7SuqNdSwBAW8Ypimt340M9GNM=; b=slWaB4qFYga/srLY8CYn5o6gpx/XEYSJcw7XFT9ggdRaoaSYHxYdFDiVuMgFipVBhp MAbifCwjvSDbZvrVchXZ3FIyZLcyDw4Bo3BnfLIO8K0mEbtESLuAzk6ZayI6kE6EkE84 IgFtJBl0KAE5AYjl4fFUq1DVEvNk7TX622P/2cmz9NAnnu8eyO6vz87z0+32ABP4kR/e KQg69o74u22MFp0jE3QVWZ1gG8Mrx7Y0UZj/G2YALMMWN+yD8Dyry0xzXeUDOLIKGqQy 6LyLlrm3Iz8lcsPMfDpedtWNA3wfzV4J9EZ/w6JdDB+YjFqpzR+XTK2cS+cCWxpWmM7U orZQ== X-Gm-Message-State: AGi0PuaImt8BnofJngt+Rlh3Aa0Hm480rt3lCJTePaK7OG/mmAO9Hm5z fE5CwzsxrWKWS34GNxKHyRrwgSHS8ntnI4yNLWU= X-Google-Smtp-Source: APiQypKHm/rgzbZfwlCVNwgys7OP8k8iW6nZ0fjZVlZoYWgCzy6JXx7ildUcT9Lwboo+5SeE1GbWFVn9UNHDc4TK11w= X-Received: by 2002:a05:6102:382:: with SMTP id m2mr10452690vsq.141.1587783278906; Fri, 24 Apr 2020 19:54:38 -0700 (PDT) MIME-Version: 1.0 References: <6D6EFA0C-36C3-4225-A331-D1998A07C50A@gmail.com> In-Reply-To: From: Rob Pike Date: Sat, 25 Apr 2020 12:54:27 +1000 Message-ID: To: Adam Thornton Content-Type: multipart/alternative; boundary="00000000000051d56005a4149adb" Subject: Re: [TUHS] v7 K&R C 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 , ak@akkartik.com Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --00000000000051d56005a4149adb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Another debate at the time was caused by a disagreement between pcc and cc regarding enums: are they a type or just a way to declare constant? I remember getting annoyed by pcc not letting me declare a constant with an enum and use it as an int. I protested to scj and dmr and after some to-ing and fro-ing Steve changed pcc to treat them as constants. Not sure it was the right decision, but C desperately wanted a non-macro way to define a constant. I'd probably argue the same way today. The real lesson is how propinquity affects progress. -rbo On Sat, Apr 25, 2020 at 12:51 PM Rob Pike wrote: > The ability to call a function pointer fp with the syntax fp() rather tha= n > (*fp)() came rather late, I think at Bjarne's suggestion or example. Pret= ty > sure it was not in v7 C, as you observe. > > Convenient though the shorthand may be, it always bothered me as > inconsistent and misleading. (I am pretty sure I used it sometimes > regardless.) > > -rob > > > On Sat, Apr 25, 2020 at 12:48 PM Adam Thornton > wrote: > >> >> >> On Apr 24, 2020, at 7:37 PM, Charles Anthony >> wrote: >> >> >> >> On Fri, Apr 24, 2020 at 7:00 PM Adam Thornton >> wrote: >> >>> This doesn=E2=80=99t like the function pointer. >>> >> >>> $ cc -c choparg.c >>> choparg.c:11: Call of non-function >>> >>> Perhaps: >> >> (*fcn)(arg); >> >> >> We have a winner! >> >> Also, Kartik, dunno where it is on the net, but if you install a v7 >> system, /usr/src/cmd/c >> >> Adam >> >> --00000000000051d56005a4149adb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Another debate at the time was caused by a disagreement be= tween pcc and cc regarding enums: are they a type or just a way to declare = constant? I remember getting annoyed by pcc not letting me declare a consta= nt with an enum and use it as an int. I protested to scj and dmr and after = some to-ing and fro-ing Steve changed pcc to treat them as constants.
<= br>
Not sure it was the right decision, but C desperately wanted = a non-macro way to define a constant. I'd probably argue the same way t= oday. The real lesson is how propinquity affects progress.

-rbo


On Sat, Apr 25, 2020 at 12:51 PM Rob Pike= <robpike@gmail.com> wrote:<= br>
The ability to call a function pointer fp with the syntax fp() rather than= (*fp)() came rather late, I think at Bjarne's suggestion or example. P= retty sure it was not in v7 C, as you observe.

Convenien= t though the shorthand may be, it always bothered=C2=A0me as inconsistent a= nd misleading. (I am pretty sure I used it sometimes regardless.)
<= br>
-rob


On Sat, Apr 25, 2020 at 12:48 = PM Adam Thornton <athornton@gmail.com> wrote:


On A= pr 24, 2020, at 7:37 PM, Charles Anthony <charles.unix.pro@gmail.com> wrote:=



On Fri, Apr 24, 2020= at 7:00 PM Adam Thornton <athornton@gmail.com> wrote:
This doesn=E2=80=99t like the functio= n pointer.

$ cc -c= choparg.c
choparg.c:11: Cal= l of non-function

= Perhaps:

=C2=A0 =C2=A0 (*fcn)(arg);
=

We have a winner!

Also, Kartik, dunno where it is on the net, but if you install a v7 syste= m, /usr/src/cmd/c

Adam

--00000000000051d56005a4149adb--