Trigraphs: a program

Richard A. O'Keefe ok at quintus.UUCP
Fri Jun 3 09:24:49 AEST 1988


In article <5611 at ico.ISC.COM>, rcd at 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.



More information about the Comp.lang.c mailing list