Re: stack overflow in quine
- From: Brian Downing <see-signature@xxxxxxxxx>
- Date: Wed, 28 Dec 2005 09:29:00 GMT
In article <1135758340.261248.53020@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
rgo <rgo@xxxxxxxxxxxxxxxx> wrote:
> Hello. I cannot understand why this program die with stack overflow:
> #1=(write '#1# :circle t)
> I tried it only on clisp 2.34. Where bug lives: in clisp or in my head?
> I think that before call to write '#1# is evaluated to circular object
> #1=(write '#1# :circle t), and function write must not to evaluate it
> again. But why overflow?
Try:
(progn #1=(write '#1# :circle t) nil)
Keep in mind that the return value of WRITE is the object that was
written, which is a circular list, and *PRINT-CIRCLE* is only bound to
T inside the WRITE call. So when the REPL prints the return value,
it will go on infinitely.
(Unless of course you manually (setf *print-circle* t) beforehand.)
-bcd
--
*** Brian Downing <bdowning at lavos dot net>
.
- Follow-Ups:
- Re: stack overflow in quine
- From: rgo
- Re: stack overflow in quine
- References:
- stack overflow in quine
- From: rgo
- stack overflow in quine
- Prev by Date: Re: stack overflow in quine
- Next by Date: Re: stack overflow in quine
- Previous by thread: Re: stack overflow in quine
- Next by thread: Re: stack overflow in quine
- Index(es):
Relevant Pages
|
|