Skip to content

Instantly share code, notes, and snippets.

@arkiver
Last active August 29, 2015 13:56
Show Gist options
  • Save arkiver/9092075 to your computer and use it in GitHub Desktop.
Save arkiver/9092075 to your computer and use it in GitHub Desktop.
Purely recursive funtion to fetch nth element of list
(defun elek (lst n)
(if (= n 0)
(progn
(car lst))
(elek (rest lst) (- n 1))
)
)
;; CL-USER> (elek '(1 2 3 4) 2)
;; 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment