match: revert to previous behavior, had a bug.

db4
John Benediktsson 2012-07-19 16:56:08 -07:00
parent 0cfc78c37c
commit eb6c03c536
1 changed files with 2 additions and 2 deletions

View File

@ -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 building get key? [ get = ] [ ,, t ] if ; dup namespace get key? [ get = ] [ set 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 swap [ drop f ] unless ; [ (match) ] H{ } make-assoc swap [ drop f ] unless ;
MACRO: match-cond ( assoc -- ) MACRO: match-cond ( assoc -- )
<reversed> <reversed>