diff --git a/chapter2.lisp b/chapter2.lisp index aa1c86c..d9a6980 100644 --- a/chapter2.lisp +++ b/chapter2.lisp @@ -118,3 +118,8 @@ and upper bound." (make-interval (* c (- 1 (/ p 100))) (* c (+ 1 (/ p 100))))) +;; Exercise 2.17 +(defun last-pair (l) + (if (null (cdr l)) + l + (last-pair (cdr l))))