Quines: self-replicating programs (2005)
You can do this way easier if the language has an &quot;exec&quot; function. Here&#x27;s a python example:<p><pre><code>  x=&quot;&quot;&quot;def f():
    print(&quot;x=&quot; + &#x27;&quot;&#x27;*3 + x + &#x27;&quot;&#x27;*3)
    print(&quot;exec(x)&quot;)
    print(&quot;f()&quot;)&quot;&quot;&quot;
  exec(x)
  f()</code></pre>