Path: csiph.com!news.redatomik.org!news.uzoreto.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: C++ features for C Date: Tue, 15 May 2018 08:53:49 -0700 Organization: None to speak of Lines: 49 Message-ID: References: <11edbfd7-461d-4579-8ac7-a9e84a6b7630@googlegroups.com> <7b110d3e-ddb5-42a0-af99-aa5b0cb30832@googlegroups.com> <13efc313-d10c-4357-9aa7-6fa55b09d948@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="fd2ef88f3973fbdcdd5cf6f7f328cfd4"; logging-data="28536"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ytxseKfz0kYOwwgZcsxfM" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:2l4dnEGBqtdVPLssoMPejXG+xQM= sha1:WH44AWXKagVj5x2ESNLaifgZ6yU= Xref: csiph.com comp.lang.c:130609 David Brown writes: > On 14/05/18 19:35, Keith Thompson wrote: >> David Brown writes: >>> On 13/05/18 22:20, Keith Thompson wrote: >> [...] >>>> You are conflating "const" and "constant". They mean two *very* >>>> different things in C. Defining an object with "const" never makes >>>> its name a constant expression. >>> >>> Yes, I know. But have been a bit loose on the technical terms in posts >>> in this thread. >> [...] >> >> Please don't. The distinction between "const" and "constant" is >> both widely misunderstood and central to the current discussion. >> Please don't add to the confusion. > > Mostly, I do try to be accurate on things like this (and I value > corrections when I am not precise). However, in this thread the term > "constant" was used from the start as a more general description rather > than the C (or C++) standards term. I think it is perhaps a little > unfortunate that the C standards use the term "constant" as a defined > term, when it is such a useful word in general discussions - confusions > are bound to occur. But we don't get to change the wording of the standard. Parts of this thread have been vague, but I don't think the word "constant" has been redefined. The main thing being discussed is proposals to add new forms of constants. > Would it make sense to refer to "C constants" when talking about the > things defined in 6.4.4 of the C standards? Or is there an alternative > general word for "values that are fixed in the source code and cannot > change"? 6.4.4 defines constants (integer-constants, floating-constants, enumeration-constants, character-constants). It makes sense to refer to them as "constants". For example, given: const int answer = 42; `answer` is not a constant, nor is it a constant expression. It's a read-only object. (There have been suggestions to make `answer` a constant expression in the future, as it is in C++.) -- 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"