diff --git a/lib/chibi/match-test.sld b/lib/chibi/match-test.sld index 9b8cdbeb..a723a31d 100644 --- a/lib/chibi/match-test.sld +++ b/lib/chibi/match-test.sld @@ -33,6 +33,7 @@ (test "or double" 'ok (match 'ok ((or (? symbol? y) y) y))) (test "or unbalanced" 1 (match 1 ((or (and 1 x) (and 2 y)) x))) (test "not" 'ok (match 28 ((not (a . b)) 'ok))) + (test "not fail" 'bad (match 28 ((not a) 'ok) (else 'bad))) (test "pred" 'ok (match 28 ((? number?) 'ok))) (test "named pred" 29 (match 28 ((? number? x) (+ x 1)))) diff --git a/lib/chibi/match/match.scm b/lib/chibi/match/match.scm index 1df1d916..2701fb65 100644 --- a/lib/chibi/match/match.scm +++ b/lib/chibi/match/match.scm @@ -385,7 +385,8 @@ ((match-two v (or p ...) g+s sk fk i) (match-extract-vars (or p ...) (match-gen-or v (p ...) g+s sk fk i) i ())) ((match-two v (not p) g+s (sk ...) fk i) - (match-one v p g+s (match-drop-ids fk) (sk ... i) i)) + (let ((sk2 (lambda () fk))) + (match-one v p g+s (match-drop-ids (sk2)) (sk ... i) i))) ((match-two v (get! getter) (g s) (sk ...) fk i) (let ((getter (lambda () g))) (sk ... i))) ((match-two v (set! setter) (g (s ...)) (sk ...) fk i)