Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!seismo!mcvax!zuring!dik From: dik@zuring.uucp (Dik T. Winter) Newsgroups: net.lang Subject: Re: Cute little liar program (for hackers only) Message-ID: <301@zuring.UUCP> Date: Fri, 20-Jun-86 21:06:22 EDT Article-I.D.: zuring.301 Posted: Fri Jun 20 21:06:22 1986 Date-Received: Wed, 25-Jun-86 06:32:47 EDT References: <7772@watdaisy.UUCP> Reply-To: dik@zuring.UUCP (Dik T. Winter) Distribution: net Organization: CWI, Amsterdam Lines: 26 Apparently-To: rnews@mcvax In article <7772@watdaisy.UUCP> mpdevine@watdaisy.UUCP writes: > > During my CS340 lectures (a second course in Data Structures), I alluded to >some of the unusual features of some programming languages, in particular Pascal >and Fortran. On the spur of the moment (as an (spectacularly unsuccessful) >attempt at stimulating class participation), I suggested an exercise: write a >program which prints the identity of the compiler used to compile it. In the >following script session, both liar.f and liar.p are links to the data file liar >(which is the program in question). > Reminds me. Eons ago I wrote a program for the CDC Cyber which would be compiled by 4 compilers (Fortran, Pascal, Algol 60 and Algol 68). The most remarkable of the program was not that it passed 4 compilers, but it reproduced itself (regardless of the compiler, however, the Algol 60 compiler choked because of some compiler restrictions). This brings on another question. Is it possible to create non-trivial input to {t,d}itroff that reproduces itself? (By non-trivial I mean it should contain at least one line starting with period or apostrophe, because, as a silly co-worker pointed out to me, the empty file reproduces itself. Also .sy should not be permitted.) -- dik t. winter, cwi, amsterdam, nederland UUCP: {seismo,decvax,philabs,okstate,garfield}!mcvax!dik or: dik@mcvax.uucp ARPA: dik%mcvax.uucp@seismo.css.gov