(defmethod p-find (value (vector persistent-array)
&key (key #'identity) (test #'p-eql)
(start 0) (end nil))
(check-p-vector vector 'p-find)
(loop for i from start below (or end (p-length vector))
do (let ((elt (funcall key (p-aref vector i))))
(when (funcall test value elt)
(return-from p-find (p-aref vector i)))))
;; Return nil if not found
nil)
Source Context