ANSI C token set (including $ and @)
Larry Jones
scjones at sdrc.UUCP
Sat Jan 21 08:59:39 AEST 1989
In article <9438 at smoke.BRL.MIL>, gwyn at smoke.BRL.MIL (Doug Gwyn ) writes:
> In article <504 at sdrc.UUCP> scjones at sdrc.UUCP (Larry Jones) writes:
> >That's what I thought, too. But Karl pointed out to me that is
> >is possible to write a strictly conforming program that will NOT
> >be interpreted correctly by an implementation that allows '$' in
> >identifiers.
>
> No, it isn't. Use of the $ character in an identifier produces
> "undefined behavior". The implementation of free to treat $ like
> _ in identifiers, because that cannot affect translation of any
> strictly conforming program.
But the critical point is that the $ character ISN'T in an
identifier if the implementation is conforming: foo$bar gets
parsed as three tokens just like foo+bar would. As long as the $
doesn't make it past the preprocessor phases of translation, I
don't see anything in the standard that makes the program non-
conforming, and that makes any implementation that allows $ in
identifiers non-conforming since they do not parse the program
correctly and thus do not translate it correctly.
Please take another look at my (well, actaully Karl's) example.
----
Larry Jones UUCP: uunet!sdrc!scjones
SDRC scjones at sdrc.UU.NET
2000 Eastman Dr. BIX: ltl
Milford, OH 45150 AT&T: (513) 576-2070
"When all else fails, read the directions."
More information about the Comp.std.c
mailing list