I have a node class that has an 'element' slot that contains a list with numbers and one letter, for example For:
'(1 2 3 b 4 5 6)
(defclass node ((element: reader get-element: author set-element : Initform '(): Initag: Element: Documentation "Element"))
Part of the program is considered to take' Element 'slot, swap one of the letters with Swap list as the number and finally a new node object as its 'element' slot I already have a swap function that receives a list and two members of that list and swaps them using rotatable functions.
To check that Swap functions was working I have made the following part of the code that stores the element in a temporary variable and swaps the letter 'B' with a number in the list:
< Code> (setf root (make-instance 'node)) (Set-element '(1 2 3B 4 5 6 7 8) root)(setf temp (get-element root)) (swap temp' b 4)
The problem is that the 'element' slot root object is temporarily swap temporarily strange I tried to change the swap function to reverse and none of the two modifies it .
I do not know in any way that a slot can give a path to any variable or to stop the above events.
Thank you.
reverse
and gives a new listRotatef < / Code> (like
setf
,incf
and so on) modify a location. You must docopy-list
orcopy-tree
yourelement
to create a new list, which you will then modify.
Comments
Post a Comment