Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!bbn.com!nic!news.cs.brandeis.edu!news!feeley From: feeley@chaos.cs.brandeis.edu (Marc Feeley) Newsgroups: comp.lang.scheme Subject: Kleene puzzle Message-ID: Date: 3 Apr 91 03:47:40 GMT Sender: usenet@news.cs.brandeis.edu Organization: Computer Science, Brandeis University, Waltham, MA, USA Lines: 10 Here is a little puzzle for all Schemers: what is the shortest standard Scheme program that writes itself on the current output port? Note that we are interested with what is PRINTED by the program and not the value of the program itself (if this was the case the single character program 0 (or any other digit) would do the trick). Here is one "self-printing" program. Is there a shorter one? (let ((x '(write `(let ((x ',x)) ,x)))) (write `(let ((x ',x)) ,x))) Marc -- feeley@cs.brandeis.edu