MATCH-VARS:
Pattern matching

Next:match ( value1 value2 -- bindings )


Vocabulary
match

Syntax
MATCH-VARS: var ... ;


Inputs
None

Outputs
None

Word description
Creates a symbol that can be used in match and match-cond for binding values in the matched sequence. The symbol name is created as a word that is defined to get the value of the symbol out of the current namespace. This can be used in match-cond to retrive the values in the quotation body.

Examples
USE: match MATCH-VARS: ?value ; { increment 346126 } { { { increment ?value } [ ?value do-something ] } { { decrement ?value } [ ?value do-something-else ] } { _ [ no-match-found ] } } match-cond


See also
match, match-cond, replace-patterns, match-replace

Definition