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=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 4987 invoked from network); 25 Apr 2020 13:19:41 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with UTF8ESMTPZ; 25 Apr 2020 13:19:41 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 639E59C961; Sat, 25 Apr 2020 23:19:28 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id C56D79C92C; Sat, 25 Apr 2020 23:18:41 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Xt1j6ROQ"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 085959C8C0; Sat, 25 Apr 2020 23:18:36 +1000 (AEST) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by minnie.tuhs.org (Postfix) with ESMTPS id A22A39C923 for ; Sat, 25 Apr 2020 23:18:32 +1000 (AEST) Received: by mail-qt1-f178.google.com with SMTP id c23so9788759qtp.11 for ; Sat, 25 Apr 2020 06:18:32 -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=uWemXT5R9tKQhj+tBaSlYkDKvB59TEzciAgOBab9WdQ=; b=Xt1j6ROQvxm/oyxRjMaGkL+XkHpqFSnwl5/QParSIEZ3wIRXr6w2xPnB616DhieqPE Cw5k9R3DA9CCOKdNqyAhVEiHJi9OWPRcYDORrs1CMdVjCcgufS9kcs7ycCa1DVfnEtgi anlrWR5qYxJjpI2lH0QKN1qlQq4YQnTJF729ARmRSsMDR8PocfyTsvjPP/MP2aU0juKU V5XZ/vOQ3+rN7r3yMpPVcptnOdiuKz+bQ+bMcD7A2THkV+XMwOWdeaTow4v80BE0Lbb9 i5SS0Ll5KlIq9dy2fNMlrh647xRC26B9+tYH75BCCcXapMnmerOZqkCR5KmJoBHIQ7n6 xPng== 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=uWemXT5R9tKQhj+tBaSlYkDKvB59TEzciAgOBab9WdQ=; b=qlS+e6gH0PEU6RT8qZU63KXYhWAH/kpSLeM7qfTzOiwnh+hpNSqAYFQOv9K4auav2j 6il6aIkMcFeNubYBMTaH1k6y3kkVLIxJb4aOssIIBXJooZ/4EnSLIivEYDzeLrupzUYy ZNK1AH8gj3UvWqrZdxcootekugYToiO5itkqX7NC6J1woXRa9PiTtfmvQmMzvQVmJn8I NQw7XNT8ZrrRsjuLTr90UeYf/YDnPtQx5Yz7HQ2V+1ah2LBq0UyTH60zOMLkl0e4jHb2 wfamTSnUhEYRkK2b/YpMTHLRHUT5uFmHvsniETHKQ2QrymxOjawnmIpMbG5cvMJSDYyi Q9eg== X-Gm-Message-State: AGi0PubSZ5WxhsPCfpMRdE3qoCVjTpClnIox9H9r0Odf/sX3YM2BsMBd UnoS9CNYya47/oU7SB+i8mIvhpJCp6rnY6tGMnYbvwyY X-Google-Smtp-Source: APiQypJ8OmMWhKbx3oJ8A0Qqd6KuCWejPyjSi7ae33vfFRIojJxC65sHonu62JfT+b3DL5Z29M/JAe0Hc1NqMahfASQ= X-Received: by 2002:ac8:47cb:: with SMTP id d11mr13512362qtr.136.1587820711766; Sat, 25 Apr 2020 06:18:31 -0700 (PDT) MIME-Version: 1.0 References: <6D6EFA0C-36C3-4225-A331-D1998A07C50A@gmail.com> <20200425030436.GF30547@mcvoy.com> In-Reply-To: From: Dan Cross Date: Sat, 25 Apr 2020 09:17:55 -0400 Message-ID: To: Clem Cole Content-Type: multipart/alternative; boundary="0000000000007df0e905a41d51c3" 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" --0000000000007df0e905a41d51c3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 24, 2020 at 11:31 PM Clem Cole wrote: > Amen bro. I always felt that they got added because pascal had something > that C didn=E2=80=99t, and yet it really was not the same. I always felt= they were > a feature that was only partly implemented and if they were not going to > be fully typed then just leave them out and use cpp like we had always do= ne > before. > Aww shucks; I actually kinda like enums. When creating sequentially numbered constants, they're convenient. That said, the typing issues I have a lot of sympathy for. For true constants, it's a shame that `const` didn't make it in earlier, though we have it now. Abusing enum to define constants certainly feels like, well, abuse. - Dan C. On Fri, Apr 24, 2020 at 11:05 PM Larry McVoy wrote: > >> 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 an= d >> 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-mac= ro >> > 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() rathe= r >> 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 < >> charles.unix.pro@gmail.com> >> > >> 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 >> > -- > Sent from a handheld expect more typos than usual > --0000000000007df0e905a41d51c3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Apr 24, 2020 at 11:31 PM Clem Col= e <clemc@ccc.com> wrote:
Amen bro.=C2=A0 I always felt that they got adde= d because pascal had something that C didn=E2=80=99t, and yet it really was= not the same.=C2=A0 I always felt they were a feature that was only partly= implemented and if they were not going =C2=A0to be fully typed then just l= eave them out and use cpp like we had always done before.=C2=A0=C2=A0
=

Aww shucks; I actually kinda like en= ums. When creating sequentially numbered constants, they're convenient.=

That said, the typing issues I have a lot of symp= athy for. For true constants, it's a shame that `const` didn't make= it in earlier, though we have it now. Abusing enum to define constants cer= tainly feels like, well, abuse.

=C2=A0 =C2=A0 =C2= =A0 =C2=A0 - Dan C.


On Fri, Apr 24, 2020 at 11:05 PM Larry McVoy <<= a href=3D"mailto:lm@mcvoy.com" target=3D"_blank">lm@mcvoy.com> wrote= :
I hate enums.= =C2=A0 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 an= d cc
> regarding enums: are they a type or just a way to declare constant? I<= br> > 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 t= o-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-mac= ro
> way to define a constant. I'd probably argue the same way today. T= he real
> lesson is how propinquity affects progress.
>
> -rbo
>
>
> On Sat, Apr 25, 2020 at 12:51 PM Rob Pike <robpike@gmail.com> wrote:
>
> > The ability to call a function pointer fp with the syntax fp() ra= ther than
> > (*fp)() came rather late, I think at Bjarne's suggestion or e= xample. Pretty
> > sure it was not in v7 C, as you observe.
> >
> > Convenient though the shorthand may be, it always bothered me as<= br> > > inconsistent and misleading. (I am pretty sure I used it sometime= s
> > regardless.)
> >
> > -rob
> >
> >
> > On Sat, Apr 25, 2020 at 12:48 PM Adam Thornton <athornton@gmail.com>
> > wrote:
> >
> >>
> >>
> >> On Apr 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???t like the function pointer.
> >>>
> >>
> >>> $ cc -c choparg.c
> >>> choparg.c:11: Call of non-function
> >>>
> >>> Perhaps:
> >>
> >>=C2=A0 =C2=A0 =C2=A0(*fcn)(arg);
> >>
> >>
> >> We have a winner!
> >>
> >> Also, Kartik, dunno where it is on the net, but if you instal= l a v7
> >> system, /usr/src/cmd/c
> >>
> >> Adam
> >>
> >>

--
---
Larry McVoy=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 l= m at mcvo= y.com=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0http://www.mcvoy.com= /lm
--
Sent from a handheld expec= t more typos than usual
--0000000000007df0e905a41d51c3--