From 2a3e2ef7aab64575dfb382d2e85c31458b05b366 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Thu, 28 Jan 2021 04:30:52 +0900 Subject: Use `nat-listp` function. --- blackjack.lisp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/blackjack.lisp b/blackjack.lisp index 2792046..47a5c20 100644 --- a/blackjack.lisp +++ b/blackjack.lisp @@ -38,15 +38,8 @@ (cons (car x) (filter-natp (cdr x)))) (t (filter-natp (cdr x))))) -(defun nat-list-p (x) - (declare (xargs :guard t)) - (cond ((consp x) - (and (natp (car x)) - (nat-list-p (cdr x)))) - (t (null x)))) - (defun sum (x) - (declare (xargs :guard (nat-list-p x))) + (declare (xargs :guard (nat-listp x))) (cond ((endp x) 0) (t (+ (car x) (sum (cdr x)))))) -- cgit v1.2.3