Path: utzoo!attcan!uunet!husc6!bbn!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!mailrus!ames!claris!apple!lenoil From: lenoil@Apple.COM (Robert Lenoil) Newsgroups: comp.lang.c Subject: Re: trigraphs in X3J11 Summary: Use \xxx notation instead of trigraphs Message-ID: <10949@apple.Apple.Com> Date: 24 May 88 00:47:27 GMT References: <5215@ico.ISC.COM> Reply-To: lenoil@apple.UUCP (Robert Lenoil) Organization: Apple Computer Inc, Cupertino, CA Lines: 21 In article <5215@ico.ISC.COM> rcd@ico.ISC.COM (Dick Dunn) writes: > Note also that it is common practice to use "?" in initializing strings > where the "?" positions will be replaced at execution time. Dick is dead right here. What is the justification for breaking existing programs when the ability to include untypeable characters into strings already exists via the \xxx mechanism? Instead of introducing a totally new notion (to C, anyway) of trigraphs, why not simply extend the backslash escape mechanism to be valid outside of strings? This would allow the use of #defines to perform the same function as trigraphs: #define ??< \173 /* open brace */ #define ??> \175 /* close brace */ By using the backslash escapes in strings and your favorite synonym outside of strings, the same effect is reached without breaking any existing code. If people don't want to use the backslash escapes in strings, they can make use of the new stringizing operators to get the #define'd constants into their strings. Robert Lenoil Apple Computer, Inc.