Name

find

Usage

builtin-function

Syntax

(find item seq &key (test =) (key identity) (default null))

Description

Returns the first element in seq matching the conditions.

user 1 > (find 4 '(1 2 3 4 5))
it: 4
user 2 > (find 99 '(1 2 3 4 5) :default -1)
it: -1
user 3 > (find 4 '("aap" "noot" "mies") :key .length)
it: "noot"
user 4 > (find 3 '("aap" "noot" "mies") :key .length :test <)
it: "noot"
user 5 > (find 3 '("aap" "noot" "mies") :key .length :test <=)
it: "aap"