Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!newsfeed.rice.edu!bcm.tmc.edu!pendragon.jsc.nasa.gov!news.msfc.nasa.gov!newsfeed.internetmci.com!EU.net!sun4nl!aie.nl!news
From: geert@sparc.aie.nl (Geert-Jan van Opdorp)
Subject: Re: self-evaluating non-atomic forms
Sender: news@aie.nl (Usenet News)
Message-ID: <GEERT.95Oct10132014@sparc.aie.nl>
In-Reply-To: Simon Brooke's message of 8 Oct 1995 20:42:28 GMT
Date: Tue, 10 Oct 1995 12:20:14 GMT
Lines: 43
X-Nntp-Posting-Host: sparc.aie.nl
References: <453r6i$448@kernighan.cs.umass.edu> <459d3k$1pm@caleddon.dircon.co.uk>
Organization: AI Engineering BV, Amsterdam, Netherlands

In article <459d3k$1pm@caleddon.dircon.co.uk> Simon Brooke <simon@rheged.dircon.co.uk> writes:

> From: Simon Brooke <simon@rheged.dircon.co.uk>
> Newsgroups: comp.lang.lisp
> Date: 8 Oct 1995 20:42:28 GMT
> Organization: Carlinscraig
> X-URL: news:453r6i$448@kernighan.cs.umass.edu
> 
> bhorowit@kerits.cs.umass.edu (Benjamin Horowitz) wrote:
> >I was recently asked the following question on a homework assignment:
> >
> >What is the shortest self-reproducing non-atomic LISP form?  A self-
> >reproducing form is one that evaluates to itself. 
> 
> ()
> 

No, nil is an atom!
Certainly the 'Goedel constructions' of the
origenal posting are the most charming ones,
but shorter is:

#1=(quote #1#)

i.e. the form you get after evaluating
(let ((answer '(quote)))
   (setf (cdr answer) answer) 
   )

Oh, set *print-circle* to T first!

Hmm I have to reset my system now,
because I tried the same thing
with "cdr" instead of "quote"... :-)

Geert-Jan


-- 
Geert-Jan van Opdorp
AI-Engineering
Amsterdam, The Netherlands
geert@aie.nl
