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.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 332 invoked from network); 25 Apr 2020 03:05:08 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with UTF8ESMTPZ; 25 Apr 2020 03:05:08 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 240F29C851; Sat, 25 Apr 2020 13:05:07 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id B3DE19C733; Sat, 25 Apr 2020 13:04:39 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 850BB9C733; Sat, 25 Apr 2020 13:04:37 +1000 (AEST) Received: from mcvoy.com (mcvoy.com [192.169.23.250]) by minnie.tuhs.org (Postfix) with ESMTPS id 244439C171 for ; Sat, 25 Apr 2020 13:04:37 +1000 (AEST) Received: by mcvoy.com (Postfix, from userid 3546) id AA78835E140; Fri, 24 Apr 2020 20:04:36 -0700 (PDT) Date: Fri, 24 Apr 2020 20:04:36 -0700 From: Larry McVoy To: Rob Pike Message-ID: <20200425030436.GF30547@mcvoy.com> References: <6D6EFA0C-36C3-4225-A331-D1998A07C50A@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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" I hate enums. I thought they would be type checked and they are just ints. I love C but enums suck. On Sat, Apr 25, 2020 at 12:54:27PM +1000, Rob Pike wrote: > 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 than > > (*fp)() came rather late, I think at Bjarne's suggestion or example. Pretty > > 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???t 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 > >> > >> -- --- Larry McVoy lm at mcvoy.com http://www.mcvoy.com/lm