Re: stack overflow in quine



rgo wrote:
> Hello. I cannot understand why this program die with stack overflow:
> #1=(write '#1# :circle t)

The :CIRCLE T keyword paramter only affects the action of the WRITE
function call. But that WRITE call also returns a value, namely the
object which was written. And your Lisp listener will try to print that
object. Since *PRINT-CIRCLE* is set to false, the listener will try to
expand the infinite object.

Your program isn't a true quine since it cheats by retrieving a copy of
its own source code, rather than computing it from scratch. The hard
work is done by the language implementation.

By the way, if the language provided a standard function called QUINE
which prints the string "(QUINE)", would the program (QUINE) be
considered a quine?

:)

.