Handbook
Glossary
(match-first) ( seq pattern-seq -- bindings leftover/f )
Vocabulary
match
Inputs
seq
an
object
pattern-seq
an
object
Outputs
bindings
an
object
leftover/f
an
object
Definition
USING:
kernel
sequences
;
IN:
match
:
(match-first)
( seq pattern-seq -- bindings leftover/f )
2dup
shorter?
[
2drop
f
f
]
[
2dup
length
head
over
match
or?
[
swap
?rest
]
[
[
rest
]
dip
(match-first)
]
if
]
if
;