[comp.std.c] Why trigraphs? What happened to the DIgraphs?

maart@cs.vu.nl (Maarten Litmaath) (06/15/88)

Why use trigraphs if digraphs are available?
E.g.:
	[ = .(
	] = .)
(Isn't the dot a much better candidate to introduce such a digraph, than a
question mark? Have you ever seen a source using many trigraphs? Ugly!)
-- 
South-Africa:                         |Maarten Litmaath @ Free U Amsterdam:
           revival of the Third Reich |maart@cs.vu.nl, mcvax!botter!ark!maart

karl@haddock.ISC.COM (Karl Heuer) (06/17/88)

In article <1302@ark.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes:
>Why use trigraphs if digraphs are available?
>	[ = .(
>	] = .)

Sorry, but ".)" is already a valid sequence in C code:  x=cos(1.)
The trigraphs have the property that no existing code contains them outside of
comments and strings.

If you're going to followup with an improved proposal, please note that there
are nine characters ( #[\]^{|}~ ) to be handled.

Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint

henry@utzoo.uucp (Henry Spencer) (06/19/88)

> If you're going to followup with an improved proposal, please note that there
> are nine characters ( #[\]^{|}~ ) to be handled.

One can get quite inventive if one really tries, and it's not that hard
to come up with things that don't conflict with normal C:

	#	%%
	[	<%
	\	!%
	]	%>
	^	&%
	{	(%
	|	:%
	}	%)
	~	?%

However, I don't really think it's worth the trouble.  The real solution
is ISO Latin 1.  Ten years hence, the issue will be seen as an amusing
historical curiosity.  It does not matter whether the sequences look good
or bad; they're never going to get used much.  It would be nicer to get
rid of them entirely, and that will probably happen when the standard
is revised some years down the road, but they're not worth all the fuss.
-- 
Man is the best computer we can      |  Henry Spencer @ U of Toronto Zoology
put aboard a spacecraft. --Von Braun | {ihnp4,decvax,uunet!mnetor}!utzoo!henry

maart@cs.vu.nl (Maarten Litmaath) (06/20/88)

In article <4599@haddock.ISC.COM> karl@haddock.ima.isc.com (Karl Heuer) writes:
\In article <1302@ark.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes:
\>Why use trigraphs if digraphs are available?
\>	[ = .(
\>	] = .)
\
\Sorry, but ".)" is already a valid sequence in C code:  x=cos(1.)

My mistake, sorry indeed.

\If you're going to followup with an improved proposal, please note that there
\are nine characters ( #[\]^{|}~ ) to be handled.

The only digraph solutions I can think of, are the use of '$', '`' or '@';
however, isn't it strange that the latter, being such a wierd character,
is supposed to be available on every terminal?
-- 
South-Africa:                         |Maarten Litmaath @ Free U Amsterdam:
           revival of the Third Reich |maart@cs.vu.nl, mcvax!botter!ark!maart