Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 (Tek) 9/26/83; site hammer.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!tektronix!orca!hammer!steveg From: steveg@hammer.UUCP (Steve Glaser) Newsgroups: net.lang.c Subject: Re: $ in identifiers -- poll Message-ID: <1040@hammer.UUCP> Date: Thu, 6-Dec-84 17:30:29 EST Article-I.D.: hammer.1040 Posted: Thu Dec 6 17:30:29 1984 Date-Received: Sat, 8-Dec-84 05:20:13 EST References: <3@aeolus.UUCP> <260@sftri.UUCP> Reply-To: steveg@hammer.UUCP (Steve Glaser) Organization: Tektronix, Wilsonville OR Lines: 54 Summary: In article <260@sftri.UUCP> jss@sftri.UUCP (J.S.Schwarz) writes: >-- > >> 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 Backquote is already used in the GCOS version of C. Try this on you're favorite C compiler (4.2 in this case, but it's in all versions of PCC I've looked for it). % cat test2.c main() { char c[] = `hi there`; } % cc test2.c "test2.c", line 3: no automatic aggregate initialization "test2.c", line 3: BCD constant exceeds 6 characters "test2.c", line 3: gcos BCD constant illegal "test2.c", line 3: illegal left operand of assignment operator % Seriously though, I can't see adding anymore letters to the C language identifier set just "cause it'd be nice and besides VMS does it". If we have to change that area, let it be in the area of somehow allowing the various national variants of the ISO character code (of which US ASCII is just one). That's the only character set issue that I can see that's important enough to warrant changing the language for. Unfortunately, with the overloading of characters ('|' is a letter in some countries), I don't see an easy solution emerging. Steve Glaser steveg.tektronix@csnet-relay tektronix!steveg