3 ms·
I like Stan Switzer's definition that "[a] quine can be formally described as a fixed point of a language's denotation function", but it's insufficient. It has
by kazinator 5y ago
I like Stan Switzer's definition that "[a] quine can be formally described as a fixed point of a language's denotation function", but it's insufficient. It has to be some interesting fixed point.
Because, not only is this such a fixed point of Lisp's denotation function:
((lambda(f)(list f (list 'quote f))) '(lambda(f)(list f (list 'quote f))))
because it calculates its own source code when evaluated at the REPL, but so is this:
0
But 0 isn't a satisfactory quine. A quine should be some sort of surprising fixed point.
The requirement that a program must produce its own image in a character stream when run in batch mode, in a language in which programs don't have access to their source code in any shape, and in which expressions do not print their values, usually is enough of a restriction that eliminates the trivial, uninteresting quines.