Guest User

Untitled

a guest
Oct 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. (defun pop-nth (place n)
  2. ""
  3. (let ((nth-place (nthcdr n place)))
  4. (prog1
  5. (car nth-place)
  6. (setcar nth-place (cadr nth-place))
  7. (setcdr nth-place (cddr nth-place)))))
  8.  
  9. (let ((x '(1 2 3 4 5)))
  10. (list (pop-nth x 3)
  11. x))
  12. ;; => '(4 (1 2 3 5))
Add Comment
Please, Sign In to add comment