From b1e2add738fbf0fc8fc590693bf332af873c1bb8 Mon Sep 17 00:00:00 2001 From: Diego Vicente Date: Tue, 18 May 2021 18:16:51 +0200 Subject: [PATCH] Add recursive solution for problem 01 --- src/problem_01.lisp | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/problem_01.lisp diff --git a/src/problem_01.lisp b/src/problem_01.lisp new file mode 100644 index 0000000..20db264 --- /dev/null +++ b/src/problem_01.lisp @@ -0,0 +1,8 @@ +;;;; P01 (*) Find the last box of a list. + +(defun p01/last (list) + "Return the last element of `list'." + (cond + ((endp list) nil) + ((endp (rest list)) list) + (t (p01/last (rest list))))) -- 2.45.2