I have a problem with this code:
(defparameter a (list 'a 'b 'c))
(defparameter b (list 'd 'e 'f))
(setf (first a) b)
(setf (first b) a)
This code halts at the last statment.
I know the reason (they are "mutually recursive" lists), but I wish to
know a similar code which works. That is, I want a reference in a to b,
and in b to a. I'd like it to be fast, too.
Thanks.
In article <························@m79g2000cwm.googlegroups.com>,
"Javier" <·······@gmail.com> wrote:
> I have a problem with this code:
>
> (defparameter a (list 'a 'b 'c))
> (defparameter b (list 'd 'e 'f))
> (setf (first a) b)
> (setf (first b) a)
>
> This code halts at the last statment.
> I know the reason (they are "mutually recursive" lists), but I wish to
> know a similar code which works. That is, I want a reference in a to b,
> and in b to a. I'd like it to be fast, too.
>
> Thanks.
Set *PRINT-CIRCLE* to T. Or don't try to print out the value after
creating the loop, since it's infinitely long, e.g.
(progn (setf (first b) a)
nil)
--
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Barry Margolin wrote:
> Set *PRINT-CIRCLE* to T. Or don't try to print out the value after
> creating the loop, since it's infinitely long, e.g.
Thank you, it does work.