Re: stack overflow in quine
- From: "Kaz Kylheku" <kkylheku@xxxxxxxxx>
- Date: 28 Dec 2005 10:15:52 -0800
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?
:)
.
- References:
- stack overflow in quine
- From: rgo
- stack overflow in quine
- Prev by Date: Re: OT: Re: Do I have to be an expert to get performance: CL versus Perl
- Next by Date: Re: Python and Lisp Test
- Previous by thread: Re: stack overflow in quine
- Next by thread: Thoughts on Stanley (DARPA Challenge)
- Index(es):