consider:
Code: Select all
(defstruct A
left
right)
(setf i (make-a)
j (make-a :left i))
Code: Select all
>j
#S(A :LEFT #S(A :LEFT NIL :RIGHT NIL) :RIGHT NIL)
Code: Select all
(setf (a-right i) j)
Code: Select all
>j
#S(A :LEFT #S(A :LEFT NIL :RIGHT #S(A :LEFT #S(A :LEFT NIL :RIGHT ..... and so on forever
if that helps:i encountered that problem as i was trying to make a BST.i wanted each node of the tree to have 3 fields,one to point to its parent,
two to point to its children...
thanks a lot for your help!