Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Using == operator Date: Tue, 03 Jan 2017 14:06:52 -0800 Organization: None to speak of Lines: 30 Message-ID: References: <4598b1a6-e647-4327-85d8-23f83198d0c6@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="f1ffbb62f7d4ea154aec5923c7307730"; logging-data="9414"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+oH77hqDZjKmx43u1k/2Hq" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:mkYvuBMfUav/OiJx1iLpKNcLjxE= sha1:KQEYcphk7dNU5i68PFBQCBXMSiE= Xref: csiph.com comp.lang.c:101043 Lew Pitcher writes: > On Monday January 2 2017 18:57, in comp.lang.c, "Keith Thompson" u@mib.org> wrote: > >> Malcolm McLean writes: >> [...] >>> Also >>> if(node->next) >>> >>> reads like English. >> >> Does it? C has the convention that using a value as a condition >> implicitly compares that value to zero. English has no such convention. >> >> For example, suppose I have a bag that may or may not contain any >> apples. In C, you can say either "if (apple_count != 0)" or >> "if (apple_count)". In English, "If the number of apples in the >> bag then ..." doesn't make sense. > > > "If there are any apples in the bag, then..." Even if we assume that that corresponds to `if (apple_count)`, what's the corresponding English for if(node->next)? -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"