Hacker News new | past | comments | ask | show | jobs | submit login
A Quine in Clojure (imagine27.com)
19 points by jgrant27 on Sept 19, 2009 | hide | past | favorite | 2 comments



This is a reimplementation of a Scheme quine. It is slightly more verbose than the Scheme version from wikipedia (http://en.wikipedia.org/wiki/Quine_(computing)#Scheme_.28als...) because 'quote x is expanded to (quote quote) x. Contrariwise, lisps may contract (quote quote) to 'quote, which is, for example, what Allegro CL 8.1 is doing.

According to http://www.nyx.net/~gthompso/self_lisp.txt, the original implementation is attributed to Chris Hruska. Other lisp implementations mentioned there tend to expand to clojure.core/seq and clojure.core/list in Clojure; expansions usually work as quines in Clojure. This is an easy exercise. :-)


A reanimated zombie corpse of a dream that prints itself.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: