Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #108485

Re: Variable naming issue

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: Variable naming issue
Date Tue, 25 Apr 2017 11:52:58 -0700
Organization None to speak of
Lines 48
Message-ID <lnh91cnwtx.fsf@kst-u.example.com> (permalink)
References <daaca66f-c8ff-41f3-99b2-d4c457b96959@googlegroups.com> <YswLA.477560$UY3.417968@fx11.am4> <odmu6j$mg$1@dont-email.me> <OPELA.457019$5u1.273856@fx03.am4> <odnaf4$6gg$1@dont-email.me> <HdHLA.398274$2K7.326696@fx18.am4> <87efwgzlqj.fsf@bsb.me.uk> <v2ILA.398632$2K7.234422@fx18.am4> <87wpa8y5vb.fsf@bsb.me.uk>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info mx02.eternal-september.org; posting-host="3b562cdb4c8656e7cfa2f1213451a6cc"; logging-data="1081"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Zko51Ls+p6LpNn6rd1ksS"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:1SSYXG1JNmlyxDTFdBgErDTIFbU= sha1:l9oRSCz1mzZLIwioUfozjPRd/jw=
Xref csiph.com comp.lang.c:108485

Show key headers only | View raw


Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
> bartc <bc@freeuk.com> writes:
>> On 25/04/2017 13:59, Ben Bacarisse wrote:
> <snip>
>>> Whatever their "excuse" it's not code size since tcc /does/ use $, it's
>>> [just] they decided to use it differently.
>>
>> In what way? I've seen it in the source code, but for something called
>> an 'ldname'.
>
> I don't know, but it is pre-processed as a single-character token so
> using it in names would require a change rather than an addition.

The $ character isn't part of the basic source or execution
character set, so it needn't be pre-processed at all.  A conforming
C implementation could easily exist on a system that doesn't support
the $ character at all.  Both ASCII and EBCDIC include it, so that's
not likely in practice -- but in the past there might have been
ASCII-based character sets that substitute some other character
for $ (I'm not sufficiently interested to verify that).

Sure, it might be a one-line compiler change to permit $ in
identifiers.  Actually more than that since it would need to
be diagnosed in conforming mode, unless you want to change the
language to allow it unconditionally -- and even then real-world C
compilers are going to have modes to enforce conformance to earlier
C standards.  And if C identifiers are mapped directly to assembly
language identifiers and/or linker symbols, there will have to be
additional code to generate valid identifiers if the assembler or
linker doesn't like $, or doesn't like it exactly the same way the
C compiler does (can it start an identifier?).

A similar level of work could allow @ and ` in identifiers.  But then
allowing ` would interfere with Markdown, which is commonly used
to quote snippets of C source code, and @ might cause other problems.

Even ignoring all that, the amount of work required to implement
a feature is only one of a number of considerations that should
affect the decision of whether to support that feature.

I've never thought that C's problem is that it doesn't use enough
punctuation characters.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
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"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Variable naming issue maximus fl <ajones2600@gmail.com> - 2017-04-24 16:17 -0700
  Re: Variable naming issue David Kleinecke <dkleinecke@gmail.com> - 2017-04-24 16:28 -0700
  Re: Variable naming issue bartc <bc@freeuk.com> - 2017-04-25 01:09 +0100
    Re: Variable naming issue Noob <root@127.0.0.1> - 2017-04-25 09:37 +0200
      Re: Variable naming issue bartc <bc@freeuk.com> - 2017-04-25 10:40 +0100
        Re: Variable naming issue David Brown <david.brown@hesbynett.no> - 2017-04-25 13:07 +0200
          Re: Variable naming issue bartc <bc@freeuk.com> - 2017-04-25 13:24 +0100
            Re: Variable naming issue bartc <bc@freeuk.com> - 2017-04-25 13:27 +0100
            Re: Variable naming issue Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-04-25 13:59 +0100
              Re: Variable naming issue bartc <bc@freeuk.com> - 2017-04-25 14:20 +0100
                Re: Variable naming issue Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-04-25 14:27 +0100
                Re: Variable naming issue Keith Thompson <kst-u@mib.org> - 2017-04-25 11:52 -0700
                Re: Variable naming issue Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-04-25 13:40 -0700
                Re: Variable naming issue bartc <bc@freeuk.com> - 2017-04-25 22:14 +0100
                Re: Variable naming issue David Brown <david.brown@hesbynett.no> - 2017-04-26 00:16 +0200
                Re: Variable naming issue bartc <bc@freeuk.com> - 2017-04-26 00:13 +0100
                Re: Variable naming issue David Brown <david.brown@hesbynett.no> - 2017-04-26 10:10 +0200
                Re: Variable naming issue supercat@casperkitty.com - 2017-04-25 14:33 -0700
                Re: Variable naming issue Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-04-25 06:39 -0700
                Re: Variable naming issue Robert Wessel <robertwessel2@yahoo.com> - 2017-04-25 09:35 -0500
              Re: Variable naming issue Gareth Owen <gwowen@gmail.com> - 2017-04-25 18:39 +0100
                Re: Variable naming issue bartc <bc@freeuk.com> - 2017-04-25 18:49 +0100
                Re: Variable naming issue David Kleinecke <dkleinecke@gmail.com> - 2017-04-25 11:19 -0700
                Re: Variable naming issue bartc <bc@freeuk.com> - 2017-04-25 19:31 +0100
                Re: Variable naming issue Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-04-25 23:36 +0100
                Re: Variable naming issue David Kleinecke <dkleinecke@gmail.com> - 2017-04-25 17:04 -0700
                Re: Variable naming issue Robert Wessel <robertwessel2@yahoo.com> - 2017-04-26 00:32 -0500
            Re: Variable naming issue David Brown <david.brown@hesbynett.no> - 2017-04-25 16:02 +0200
            Re: Variable naming issue Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-02 05:25 -0700
              Re: Variable naming issue supercat@casperkitty.com - 2017-05-02 10:04 -0700
                Re: Variable naming issue Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-05 03:06 -0700
          Re: Variable naming issue supercat@casperkitty.com - 2017-04-25 07:12 -0700
          Re: Variable naming issue Robert Wessel <robertwessel2@yahoo.com> - 2017-04-25 09:48 -0500
            Re: Variable naming issue Robert Wessel <robertwessel2@yahoo.com> - 2017-04-25 09:52 -0500
        Re: Variable naming issue Noob <root@127.0.0.1> - 2017-04-26 08:46 +0200
          Re: Variable naming issue bartc <bc@freeuk.com> - 2017-04-26 11:46 +0100
          Re: Variable naming issue bartc <bc@freeuk.com> - 2017-04-26 12:00 +0100
        Re: Variable naming issue gordonb.o1c18@burditt.org (Gordon Burditt) - 2017-05-07 22:25 -0500
          Re: Variable naming issue bartc <bc@freeuk.com> - 2017-05-08 10:35 +0100
            Re: Variable naming issue bartc <bc@freeuk.com> - 2017-05-08 10:53 +0100
              Re: Variable naming issue David Kleinecke <dkleinecke@gmail.com> - 2017-05-08 11:47 -0700
                Re: Variable naming issue bartc <bc@freeuk.com> - 2017-05-08 19:59 +0100
      Re: Variable naming issue gazelle@shell.xmission.com (Kenny McCormack) - 2017-04-25 10:43 +0000
    Re: Variable naming issue Robert Wessel <robertwessel2@yahoo.com> - 2017-04-25 09:33 -0500
  Re: Variable naming issue Keith Thompson <kst-u@mib.org> - 2017-04-24 17:26 -0700
    Re: Variable naming issue maximus fl <ajones2600@gmail.com> - 2017-04-24 18:18 -0700
  Re: Variable naming issue scott@slp53.sl.home (Scott Lurndal) - 2017-04-25 14:48 +0000

csiph-web