fork download
  1. (defun help-func (n list)
  2. (cond
  3. ((= n 1) (car list))
  4. (T (help-func (1- n) (cdr list)))))
  5.  
  6. (defun no-nth (n list)
  7. (cond
  8. ((or (< n 0) (>= n (length list))) 'invalid-index)
  9. (T (help-func n list))))
  10.  
  11. (print (no-nth 2 '(1 6 7)))
  12. (print (no-nth 21 '(1 2 3)))
Success #stdin #stdout 0.02s 10584KB
stdin
Standard input is empty
stdout
6 
INVALID-INDEX