OT: C, Unix hoax [was: Re: Everyone here should read this.. I thought I'd seen]

From: Paul Williams <flo_at_rdel.co.uk>
Date: Mon Dec 6 05:01:54 1999

Derek Peschel wrote:

> There is an April Fool's post in which K&R admit UNIX was a hoax:
>
> We stopped when we got a clean compile on the following syntax:
>
> for(;P("\n"),R-;P("|"))for(e=C;e-;P("_"+(*u++/8)%2))P("| "+(*u/4)%2);
>
> To think that modern programmers would try to use a language that
> allowed such a statement was beyond our comprehension! We actually
> thought of selling this to the Soviets to set their computer science
> progress back 20 or more years.

I've wondered about that line for ages. For starters, it has several
typos. I think the corrected version is:

for(;P("\n"),R--;P("|"))for(e=C;e--;P("_ "+(*u++/8)%2))P("| "+(*u/4)%2);

(ie. decrement operator inserted twice, and the underscore needs a space
after it)

As this code does something useful, I can't imagine anyone writing it
just for the sake of a joke, so does anyone know where it came from?
Received on Mon Dec 06 1999 - 05:01:54 GMT

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:31:54 BST