lambdabot

Untitled

Nov 3rd, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.22 KB | None | 0 0
  1. (defun leng (list &optional (len-so-far 0))
  2.  "Tamanho da lista tail-racursive"
  3.   (if (null list)
  4.       len-so-far
  5.       (leng (rest list) (+ 1 len-so-far))))
  6.  
  7. (setq a (read-line))
  8. (write (leng (parse-integer a)))
Advertisement
Add Comment
Please, Sign In to add comment