transcendental-lisp/lisp/tail/length-recursion.lisp

12 lines
277 B
Common Lisp
Raw Normal View History

2017-11-12 13:27:04 -05:00
(load "../lang/functions.lisp")
2017-11-12 13:27:04 -05:00
(defun build (n lst)
(if (= n 0) lst
(build (- n 1) (cons (car lst) lst))))
(defun build2 (n lst)
(if (= n 0) lst
(build2 (- n 1) (build 200 lst))))
2017-11-12 16:40:49 -05:00
(length (build2 200 (build2 200 (build2 200 (build2 200 '(1 1 1 1 0 0 0 0))))))