From b8690c9e5ff186f8bcf6bc944b0b2569c6ae3e26 Mon Sep 17 00:00:00 2001 From: Tobias Eidelpes Date: Sat, 5 Nov 2022 14:59:04 +0100 Subject: [PATCH] Add Exercise 2.17 --- chapter2.lisp | 5 +++++ 1 file changed, 5 insertions(+) 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))))