(defun n1 (&optional (x 1000)) (if (< x 0) 0 (+ x (n1 (- x 1))))) (defun n2 () (labels ((n0 (x) (if (< x 0) 0 (+ x (n0 (- x 1)))))) (n0 1000))) (defun n3 () (do* ((x 1000 (1- x)) (sum x (+ sum x))) ((< x 0) sum))) (defun ns () (let ((r 100000)) (print t) (time (dotimes (i r) t)) (print 'n1) (time (dotimes (i r) (n1))) (print 'n2) (time (dotimes (i r) (n2))) (print 'n3) (time (dotimes (i r) (n3)))))