'list)
(t
(give-up-ir1-transform
- "can't determine result type")))))
+ "result type unsuitable")))))
(cond ((and result-type-value (null seqs))
;; The consing arity-1 cases can be implemented
;; reasonably efficiently as function calls, and the cost
,n-sequence ,start ,n-end)))
(block ,block
(macrolet ((maybe-return ()
- '(let ((,element (aref ,sequence ,index)))
+ ;; WITH-ARRAY-DATA has already performed bounds
+ ;; checking, so we can safely elide the checks
+ ;; in the inner loop.
+ '(let ((,element (locally (declare (optimize (insert-array-bounds-checks 0)))
+ (aref ,sequence ,index))))
(when ,done-p-expr
(return-from ,block
(values ,element
(macrolet ((define-find-position (fun-name values-index)
`(deftransform ,fun-name ((item sequence &key
from-end (start 0) end
- key test test-not))
+ key test test-not)
+ (t (or list vector) &rest t))
'(nth-value ,values-index
(%find-position item sequence
from-end start
(macrolet ((define-find-position-if (fun-name values-index)
`(deftransform ,fun-name ((predicate sequence &key
from-end (start 0)
- end key))
+ end key)
+ (t (or list vector) &rest t))
'(nth-value
,values-index
(%find-position-if (%coerce-callable-to-fun predicate)
(macrolet ((define-find-position-if-not (fun-name values-index)
`(deftransform ,fun-name ((predicate sequence &key
from-end (start 0)
- end key))
+ end key)
+ (t (or list vector) &rest t))
'(nth-value
,values-index
(%find-position-if-not (%coerce-callable-to-fun predicate)