From f5630827636bc64a50662cced8b0fd758bcd2ce8 Mon Sep 17 00:00:00 2001 From: ram <ram> Date: Mon, 25 Feb 1991 23:58:42 +0000 Subject: [PATCH] Changed some broken explicit argument type checking in [N]BUTLAST to be argument type declarations. --- code/list.lisp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/code/list.lisp b/code/list.lisp index 1c77bf5ad..032da6a90 100644 --- a/code/list.lisp +++ b/code/list.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/list.lisp,v 1.6 1991/02/08 13:33:49 ram Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/list.lisp,v 1.7 1991/02/25 23:58:42 ram Exp $") ;;; ;;; ********************************************************************** ;;; @@ -352,10 +352,9 @@ (defun butlast (list &optional (n 1)) "Returns a new list the same as List without the N last elements." - (unless (integerp n) - (error "Wrong type argument, ~S, should have been of type INTEGER.")) + (declare (list list) (type integer n)) (if (< n 0) (setq n 0)) - (let ((length (1- (length (the list list))))) + (let ((length (1- (length list)))) (declare (fixnum length)) (if (< length n) () @@ -368,10 +367,9 @@ (defun nbutlast (list &optional (n 1)) "Modifies List to remove the last N elements." - (unless (integerp n) - (error "Wrong type argument, ~S, should have been of type INTEGER.")) + (declare (list list) (type integer n)) (if (< n 0) (setq n 0)) - (let ((length (1- (length (the list list))))) + (let ((length (1- (length list)))) (declare (fixnum length)) (if (< length n) () (do ((1st (cdr list) (cdr 1st)) -- GitLab