Handbook
Glossary
(match) ( value1 value2 -- matched? )
Vocabulary
match
Inputs
value1
an
object
value2
an
object
Outputs
matched?
an
object
Definition
USING:
classes
classes.tuple
combinators
kernel
sequences
;
IN:
match
:
(match)
( value1 value2 -- matched? )
{
{
[
dup
match-var?
]
[
set-match-var
]
}
{
[
over
match-var?
]
[
swap
set-match-var
]
}
{
[
2dup
=
]
[
2drop
t
]
}
{
[
2dup
[
_
eq?
]
either?
]
[
2drop
t
]
}
{
[
2dup
[
sequence?
]
both?
]
[
2dup
[
length
]
same?
[
[
(match)
]
2all?
]
[
2drop
f
]
if
]
}
{
[
2dup
[
tuple?
]
both?
]
[
2dup
[
class-of
]
same?
[
[
tuple-slots
]
bi@
[
(match)
]
2all?
]
[
2drop
f
]
if
]
}
[
2drop
f
]
}
cond
;