Code: Select all
> (set 'aList '((a 1 2 3)(b 4 5 6)(c 7 8 9)))
((a 1 2 3) (b 4 5 6) (c 7 8 9))
> (replace-assoc 'b aList '(q "I am the replacement"))
((a 1 2 3) (q "I am the replacement") (c 7 8 9))
> aList
((a 1 2 3) (q "I am the replacement") (c 7 8 9))
Code: Select all
newLISP v.9.2.0 on Win32.
> (set 'aList '(((a 1 2 3)(b 4 5 6)(c 7 8 9))))
(((a 1 2 3) (b 4 5 6) (c 7 8 9)))
> (replace-assoc 'b (aList 0) '(q "I am the replacement"))
((a 1 2 3) (q "I am the replacement") (c 7 8 9))
> aList
(((a 1 2 3) (b 4 5 6) (c 7 8 9)))
>
So whats the best way?