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=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2137 invoked from network); 11 May 2020 00:58:17 -0000 Received-SPF: pass (minnie.tuhs.org: domain of minnie.tuhs.org designates 45.79.103.53 as permitted sender) receiver=inbox.vuxu.org; client-ip=45.79.103.53 envelope-from= Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 11 May 2020 00:58:17 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 2A6759C2EF; Mon, 11 May 2020 10:58:14 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id C8A799C2ED; Mon, 11 May 2020 10:57:49 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 119C09C2ED; Mon, 11 May 2020 10:57:47 +1000 (AEST) Received: from mcvoy.com (mcvoy.com [192.169.23.250]) by minnie.tuhs.org (Postfix) with ESMTPS id A10EF9B75D for ; Mon, 11 May 2020 10:57:46 +1000 (AEST) Received: by mcvoy.com (Postfix, from userid 3546) id 15BB135E12D; Sun, 10 May 2020 17:57:46 -0700 (PDT) Date: Sun, 10 May 2020 17:57:46 -0700 From: Larry McVoy To: Rob Pike Message-ID: <20200511005745.GL17035@mcvoy.com> References: <6D6EFA0C-36C3-4225-A331-D1998A07C50A@gmail.com> <3cb1126796176debe28aa66672ba27ae@yaccman.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" My mail is screwed up, I see Rob's reply to Steve but didn't see Steve's original. > On Mon, May 11, 2020 at 10:28 AM wrote: > > With respect to enums, there is a feature I've wanted for years: a typed > > typedef. Saying typetdef int foo would make foo an integer, but if you > > passed an ordinary int to something declared as foo it would be an error. > > Even if it was an integer constant unless cast. Steve, I couldn't agree more, you are 100% right, this is how it should work. I wanted to like enums because I naively thought they'd have these semantics but then learned they really aren't any different than a well managed list of #defines. IMHO, without your semantics, enums are pretty useless, #define is good enough and more clear. --lm