diff options
-rw-r--r-- | share/txr/stdlib/match.tl | 2 | ||||
-rw-r--r-- | tests/011/patmatch.tl | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/share/txr/stdlib/match.tl b/share/txr/stdlib/match.tl index d3d89702..0e48773f 100644 --- a/share/txr/stdlib/match.tl +++ b/share/txr/stdlib/match.tl @@ -836,7 +836,7 @@ (labels ((bound-p (vlist vars sym) (cond ((bindable sym) (or (member sym vars) vlist.(exists sym))) - ((null sym) t) + ((null sym) nil) ((compile-error *match-form* "bindable symbol expected, not ~s" sym)))) (normalize (args) diff --git a/tests/011/patmatch.tl b/tests/011/patmatch.tl index 063e574b..54dda990 100644 --- a/tests/011/patmatch.tl +++ b/tests/011/patmatch.tl @@ -344,7 +344,11 @@ (test (when-match `@a` "abc" a) "abc") (macro-time-let ((*stderr* *stdnull*)) - (test (when-match `@a@b` "abc" a) :error)) + (test (when-match `@a@b` "abc" a) :error) + (test (when-match `@nil@b` "abc" a) :error) + (test (when-match `@nil@nil` "abc" a) :error) + (test (when-match `@a@nil` "abc" a) :error)) + (test (when-match `@a-$` "a-$" a) "a") (test (when-match `#@a-$` "#a-$" a) "a") |