$ in identifiers -- poll
J.S.Schwarz
jss at sftri.UUCP
Thu Dec 6 02:43:13 AEST 1984
--
> I'd like to bring up the matter of using '$' in C identifiers. Here are
> several points of view I've come across:
>
> What does the standard say about this? '$' is not used anywhere else in C.
> I think its use as a letter should be officially permitted. (It makes a
> nice "package" identifier, c.f. VMS.)
The latest (Oct 31) ANSI draft that I have does not include '$' as
a character in identifiers.
It should be pointed out that many preprocessors (such as YACC) use
'$' in some way to distinguish "special" identifiers. It would
cause confusion if '$' was now made legal in ordinary C identifiers.
Looking at my keyboard, the characters not currently used by C (outside
of comments and strings) are '@', '$', and backquote(`). If you really
need a new nonalphabetic character in identifiers I would suggest backquote.
Identifiers like xyz`p look nice to me. (But personally, I see no
need for such a modification to the language definition.)
Jerry Schwarz
ihnp4!btlunix!jss
More information about the Comp.lang.c
mailing list