My Adventure Writing My First Quine in Java(blogs.adobe.com) |
My Adventure Writing My First Quine in Java(blogs.adobe.com) |
And here's a little write-up on how I approached the problem: https://nolancaudill.com/2011/01/01/how-to-build-a-quine/
((lambda (x) (list x (list 'quote x))) '(lambda (x) (list x (list 'quote x))))
returns itself (note: written in Clisp; I've had issues with Lispworks doing things properly). You can also stuff messages in there pretty easily:
((lambda (x y) (list x (list 'quote x) y)) '(lambda (x y) (list x (list 'quote x) y)) "Hello, world")
def q(s):
print(s+'q(""' '"'+s+'"' '"")')
q("""def q(s):
print(s+'q(""' '"'+s+'"' '"")')
""") $ python quine.py
import sys
print open(sys.argv[0]).read(),Sometimes writing python literally feels like taking candy from a baby
I made this mistake the first time I tried too.