diff --git a/package.lisp b/package.lisp index babeb9545ed9f41525e9a92ad020ca5f1a501d9b..cf258fc19d74f257a5f38c983a3be70271e8fddb 100644 --- a/package.lisp +++ b/package.lisp @@ -114,7 +114,6 @@ #:map-combinations #:map-derangements #:map-permutations - #:no-extremum #:proper-sequence #:random-elt #:removef diff --git a/sequences.lisp b/sequences.lisp index cb01081f9df477e339efd08b195d29a58ef9f648..8b9a44328542d4e10e9e852da1d8db266c45ec62 100644 --- a/sequences.lisp +++ b/sequences.lisp @@ -506,8 +506,7 @@ The arguments to the PREDICATE function are computed from elements of SEQUENCE using the KEY function, if supplied. If KEY is not supplied or is NIL, the sequence element itself is used. -If SEQUENCE is empty, then the error NO-EXTREMUM is signalled. Invoking the -CONTINUE restart will cause extremum to return NIL." +If SEQUENCE is empty, NIL is returned." (let* ((pred-fun (ensure-function predicate)) (key-fun (unless (or (not key) (eq key 'identity) (eq key #'identity)) (ensure-function key))) @@ -529,7 +528,7 @@ CONTINUE restart will cause extremum to return NIL." (declare (dynamic-extent #'reduce-elts)) (reduce #'reduce-elts sequence :start start :end real-end)))) ((= real-end start) - (cerror "Return NIL instead." 'no-extremum)) + nil) (t (error "Invalid bounding indexes for sequence of length ~S: ~S ~S, ~S ~S" (length sequence) diff --git a/tests.lisp b/tests.lisp index e218113b054e3712c212d23dc94fa16c4bb714c6..7ffe30fa5ce6b619b12ee131b4e3231df5781f31 100644 --- a/tests.lisp +++ b/tests.lisp @@ -1848,11 +1848,7 @@ (incf n)) (when (eql -1000 (extremum #(100 1 10 -1000) #'> :key 'abs)) (incf n)) - (let ((err nil)) - (handler-bind ((no-extremum (lambda (c) - (setf err c) - (continue c)))) - (when (eq nil (extremum "" #'error)) - (when err - (incf n)))))) + (when (eq nil (extremum "" (lambda (a b) (error "wtf? ~S, ~S" a b)))) + (incf n)) + n) 13)