Handbook
Glossary
sorted-member? ( obj seq -- ? )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Binary search
Prev:
sorted-index ( obj seq -- i )
Next:
sorted-member-eq? ( obj seq -- ? )
Vocabulary
binary-search
Inputs
obj
an
object
seq
a sorted sequence
Outputs
?
a
boolean
Word description
Tests if the sorted sequence contains
elt
. Equality is tested with
=
.
See also
member?
Definition
USING:
kernel
;
IN:
binary-search
:
sorted-member?
( obj seq -- ? )
dupd
natural-search
nip
=
;