Name

position-if

Usage

builtin-function

Syntax

(position-if predicate seq &key (key identity))

Description

Returns the position of the first item in seq that satisfies the function predicate.

user 1 > (position-if odd? '(2 3 4))
it: 1
user 2 > (position-if odd? '(2 4))
it: null
user 3 > (position-if odd? (vector "aap" "noot" "mies") :key length)
it: 0