3 ms·
I think that using any kind of self-referential technique in a quine is cheating. If you learn how to write a quine in an 'ordinary' language, then the same te
by DannyB2 8y ago
I think that using any kind of self-referential technique in a quine is cheating.
If you learn how to write a quine in an 'ordinary' language, then the same technique works in Clojure or anything else.
SPOILER
There is basically a pattern to how it works. The program consists of a Start and a Finish section. In the middle are two arrays of strings. The first array is the strings of the code of the Start section, and the second array is the Finish section.
The Start and/or Finish section are the mechanics that prints out the two arrays of strings.
First print out the first array, eg, the Start section.
Next print out the first array again, but 'quoted' in a way that it actually forms the code that initializes the first array.
Next print out the second array in the same quoted way that it actually forms the code initializing the second array.
Last, print out the second array.