match: make-assoc: -1
parent
23d6c4fe4a
commit
d9da6e4781
|
@ -23,7 +23,7 @@ SYNTAX: MATCH-VARS: ! vars ...
|
||||||
dup word? [ "match-var" word-prop ] [ drop f ] if ;
|
dup word? [ "match-var" word-prop ] [ drop f ] if ;
|
||||||
|
|
||||||
: set-match-var ( value var -- ? )
|
: set-match-var ( value var -- ? )
|
||||||
dup namespace key? [ get = ] [ set t ] if ;
|
building get ?at [ = ] [ ,, t ] if ;
|
||||||
|
|
||||||
: (match) ( value1 value2 -- matched? )
|
: (match) ( value1 value2 -- matched? )
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,7 @@ SYNTAX: MATCH-VARS: ! vars ...
|
||||||
} cond ;
|
} cond ;
|
||||||
|
|
||||||
: match ( value1 value2 -- bindings )
|
: match ( value1 value2 -- bindings )
|
||||||
[ (match) ] H{ } make-assoc swap [ drop f ] unless ;
|
[ (match) ] H{ } make swap [ drop f ] unless ;
|
||||||
|
|
||||||
MACRO: match-cond ( assoc -- )
|
MACRO: match-cond ( assoc -- )
|
||||||
<reversed>
|
<reversed>
|
||||||
|
|
Loading…
Reference in New Issue