5 ms·
A Quine in Clojure
- cema 17y agoThis 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_.28also_valid_Common_Lisp.29 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 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. :-)
- WilliamLP 17y agoA reanimated zombie corpse of a dream that prints itself.