Path: utzoo!attcan!uunet!ccicpg!zardoz!dhw68k!david From: david@dhw68k.cts.com (David H. Wolfskill) Newsgroups: comp.std.c Subject: Re: Portable Self-Replicating C Contest Message-ID: <22138@dhw68k.cts.com> Date: 15 Apr 89 22:25:34 GMT References: <12144@haddock.ima.isc.com> <12593@haddock.ima.isc.com> <6647@bsu-cs.bsu.edu> <12629@haddock.ima.isc.com> <6756@bsu-cs.bsu.edu> Reply-To: david@dhw68k.cts.com (David H. Wolfskill) Organization: Wolfskill & Dowling residence; Anaheim, CA (USA) Lines: 66 In article <6756@bsu-cs.bsu.edu> dhesi@bsu-cs.bsu.edu (Rahul Dhesi) writes: >In article <12629@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) >writes: >>(One correct fix is to use `printf("?\?=")', but since `\' is itself a >>trigraphable character, this must be written `printf("???/?=")'!) > ^^^^^^ >This seems awfully difficult for a lexical analyzer to handle, and >perhaps illustrates my point again. (Isn't ? itself a trigraph >character, at least when ambiguity requires it?) No, '?' is *not* representable by a trigraph sequence. Section 2.2.1.1 ("Trigraph Sequences") reads (in the May 13, 1988 draft): -=-=-=-=-=-=-=-=-=-=-= All occurrences in a source file of the following sequences of three characters (called *trigraph sequences*[5]) are replaced with the corresponding single character. ??= # ??( [ ??/ \ ??) ] ??' ^ ??< { ??! | ??> } ??- ~ No other trigraph sequences exist. Each ? that does not begin one of the trigraphs listed above is not changed. Example The following source line printf("Eh???/n"); becomes (after replacement of the trigraph sequence ??/) printf("Eh?\n"); ----- 5. The trigraph sequences enable the input of characters that are not defined in the ISO 646-1983 Invariant Code Set, which is a subset of the seven-bit ASCII code set. -=-=-=-=-=-=-=-=-=-=-= >As a sporting gesture, would you be willing to repost the contest >rules, this time using trigraphs only in place of the offending >symbols? If that doesn't make my point, nothing will. I think Karl's rules were clear enough. As to the trigraphs, I don't know of anyone who claims that they are aesthetically pleasing; some mechanism, however, needs to exist for representing characters that do not exist in an environment's character set (unless, of course, X3J11 had been willing to banish folks in such circumstances to a C-less existence). To quote Douglas Adams (note "Adams," not "Gwyn") "You were quite entitled to make any suggestions or protests at the appropriate time, you know." david -- David H. Wolfskill uucp: ...{spsd,zardoz,felix}!dhw68k!david InterNet: david@dhw68k.cts.com