- Code: Select all
> (defun it-nth (n x) (dotimes (i n (first x)) (pop x)))
IT-NTH
> (setf foo '(a b c d e f))
(A B C D E F)
> (it-nth 4 foo)
E
> foo
(A B C D E F)
> (defun it-nth (n x) (dotimes (i n (first x)) (pop x)))
IT-NTH
> (setf foo '(a b c d e f))
(A B C D E F)
> (it-nth 4 foo)
E
> foo
(A B C D E F)
- Code: Select all
(setf foo '(a b c))
(setf bar '(d e f))
(setf foo (nconc foo bar)) ; <= correct
learningcommonlisp wrote:Well I think this is wrong nevertheless as a literal list is modified here...
Users browsing this forum: Bing [Bot] and 1 guest