Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!cmcl2!brl-adm!umd5!ames!lll-tis!mordor!joyce!sri-unix!quintus!ok From: ok@quintus.UUCP (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: Trigraphs: a program Message-ID: <1052@cresswell.quintus.UUCP> Date: 2 Jun 88 23:24:49 GMT References: <1032@cresswell.quintus.UUCP> <5611@ico.ISC.COM> Organization: Quintus Computer Systems, Mountain View, CA Lines: 35 In article <5611@ico.ISC.COM>, rcd@ico.ISC.COM (Dick Dunn) writes: > > Here is a program which can be used to determine whether ANSI trigraph > > processing will have an adverse effect on your code... > ...and then, instructions on how to use it in UNIX... > but I wonder why a UNIX user would write a program to do what a one-line > command can do? Thanks I wasn't expecting, but sneers I can do without. (1) I'd like to know what that one-line command is. tr can't do the job, because it maps single characters to single characters. You can do it with sed, with a script like s/??{/g ... s/??\//\\/g but that hardly counts as a one-line command. (One of the messages in comp.lang.c proposed sed -e "s;??\\([-=(/)']\\);?\\\\?\\1;g" *as a method of protecting against trigraphs*, but that is not what 3g does.) (2) Surely it must be obvious that the program was not provided for the sole benefit of UNIX users. Most of the trigraph characters are used heavily by 'sh' and 'csh'. So anyone who is using UNIX is *already* using some solution to the non-ISO-646-character problem. I don't see why people using VMS or MSDOS should be left without a tool for checking whether trigraphs will hurt them just because they aren't running UNIX. > And, all seriousness aside, shouldn't the program have been written with > trigraphs? (It IS kind of fun to see what it looks like.) (3) The program was provided to let people check whether their code would be adversely affected if and when trigraph-processing compilers arrived. Trigraphs not being widely supported yet, using them in the program would have been a good way of making it unusable. That was not my goal.