(defun nthFromEnd (lst n) (labels ((from-end-helper (lst n) (if (null lst) 0 (let ((ret (from-end-helper (cdr lst) n))) (if (eq ret n) (throw 'answer (car lst)) (+ ret 1)))))) (catch 'answer (when (from-end-helper lst n) nil)))) CL-USER> (nthfromend '(1 2 3 4 5) 6) NIL CL-USER> (nthfromend '(1 2 3 4 5) 3) 2 CL-USER> (nthfromend '(1 2 3 4 5) 0) 5