title: What is the "trick" to writing a Quine?
body: <p>I read Ken Thompson's classic paper <a href="http://web.archive.org/web/20150309043401/http://cm.bell-labs.com/who/ken/trust.html" rel="noreferrer">Reflections on Trusting Trust</a> in which he prompts users to write a <a href="http://en.wikipedia.org/wiki/Quine_%28computing%29" rel="noreferrer">Quine</a> as an introduction to his argument (highly recommended read).</p>
  
  <blockquote>
    <p>A quine is a computer program which takes no input and produces a copy of its own source code as its only output.</p>
  </blockquote>
  
  <p>The naive approach is simply to want to say:</p>
  
  <pre><code>print "[insert this program's source here]"
  </code></pre>
  
  <p>But one quickly sees that this is impossible. I ended up <a href="http://blog.paislee.net/2011/02/self-reproducing-python-3-program.html" rel="noreferrer">writing one myself</a> using Python but still have trouble explaining "the trick". <strong>I'm looking for an excellent explanation of why Quines are possible.</strong></p>