Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun pop-nth (place n)
- ""
- (let ((nth-place (nthcdr n place)))
- (prog1
- (car nth-place)
- (setcar nth-place (cadr nth-place))
- (setcdr nth-place (cddr nth-place)))))
- (let ((x '(1 2 3 4 5)))
- (list (pop-nth x 3)
- x))
- ;; => '(4 (1 2 3 5))
Add Comment
Please, Sign In to add comment