Why are @, `, and $ not used in C?

Dave Hamaker dwh at twg-ap.UUCP
Thu Sep 21 13:33:02 AEST 1989


>From article <509.nlhp3 at oracle.nl>, by bengsig at oracle.nl (Bjorn Engsig):
> By mistake, I just typed a define as VALUE@ in stead of VALUE2, and I 
> realised that it didn't look like C at all.  A quick glance on my keyboard
> shows three characters, @, `, and $ that cannot be used in C outside of
> strings.  Is there any historic reason for that?
> 
> I know that $ is often allowed in identifiers so that is ruled out, but
> couldn't @ and/or ` have been used for something useful.
> -- 
> Bjorn Engsig, bengsig at oracle.nl, bengsig at oracle.com, mcvax!orcenl!bengsig

I'd guess the non-use of @ is connected with its use as the Unix line-kill
character which has fallen into disuse in these days of CRT terminals (even
though @ is often still the default kill character).  Ironically, the # is
used in C when it had a similar role as the erase editing character; maybe
the preprocessor came second.  ` and $ might have something to do with the
original Ascii having different graphics for ` and _ (up arrow and left
arrow, I think).  _ could have replaced $ use in identifiers and ` may not
have had enough potential use to get added later on (besides the potential
confusion with ').

These are possible historical reasons but they're not authoritive.  Someone
else may know.

-Dave Hamaker
The Wollongong Group
...!amdahl!twg-ap!dwh
dwh at twg.com



More information about the Comp.lang.c mailing list