Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!news-out.readnews.com!transit3.readnews.com!s09-10.readnews.com!not-for-mail From: Patrick Scheible Newsgroups: comp.lang.c Subject: Re: trigraphs, yecch References: <4f2808f4.648026530@text.giganews.com> <86aa53e59d.fsf@zipcon.net> Date: Wed, 01 Feb 2012 11:11:37 -0800 Message-ID: <86aa52tlli.fsf@zipcon.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (berkeley-unix) Cancel-Lock: sha1:ghHmkYxWtWaGuzBIckD2eQAzXC4= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Lines: 66 Organization: The Zip Connection (zipcon.net) NNTP-Posting-Host: b6ca6417.news.zipcon.net X-Trace: DXC=<<=dMIE[]\7[oSJ=8Q]]P1U>Dm5d6:E6=YVOId^O@nF6;:7LAL_EVZ9_A>1gcoFWo=fGGV:eDDfa5 X-Complaints-To: abuse@zipcon.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:16602 James Kuyper writes: > On 01/31/2012 08:01 PM, Patrick Scheible wrote: >> Keith Thompson writes: > ... >>> For reference, there are exactly 9 trigraphs. C99 5.2.1.1: >>> >>> All occurrences in a source file of the following sequences of three >>> characters (called trigraph sequences) 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. >>> >>> In your case, "???" is not a trigraph, but ??) is. >> >> Has the C standards committee been flamed enough for trigraphs? I don't >> think so. I bet there's 1000 programmers bitten by them for every 1 >> who's been helped. By 1989 anyone who didn't have an editor capable of >> typing any 7-bit ASCII character ... > > Every single one of the characters for which there's a corresponding > trigraph sequence, is on that list precisely it's not in the "invariant > set" supported by all of the national variants of the ISO/IEC 646 7-bit > encoding. If you lived in one of the nations for which those national > variants was created, an editor which supported only strict 7-bit ASCII > would not have been very useful - that's precisely why the national > variants were created. The invariant subset of ASCII was an unsatisfactory solution to everyone, including people working in the languages for which it was created. The characters lost by accented characters are used for many purposes, not just C. And many people need to be able to represent accented characters from several different languages in the same document. The Unicode committe was already meeting in 1989. The C committee should have stuck to ad-hoc preprocessors for people using C in a non-full-ASCII language until Unicode was ready, only another few years. > There are work-arounds; such as standard conventions for transliterating > a German letter such as รถ into oe, but those conventions implement > essentially the same idea as trigraphs: using multiple representable > characters to indirectly represent a single character that's not > directly representable. > >> ... was a hopeless luddite who would be >> better served making their own pre-preprocessing phase for C and leaving >> the language unchanged instead of another phase in the preprocessor for >> every C program forever and ever. > > I'm not arguing that trigraphs were a good solution to the problem. But > restricting editors to 7-bit ASCII was not an acceptable solution, > either. That's why one of the Scandinavian countries (I forget which > one) refused to approve the C standard until some accomodation was made > to the needs of people for whom 7-bit ASCII was unacceptable. The result > was a political compromise, and like most such, it was equally > unattractive to all parties engaged in the negotiations. Thankfully, Ritchie didn't have get an international committee's blessing in order to create C. -- Patrick