diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-01-27 22:31:48 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-01-27 22:31:48 -0800 |
commit | 32e187c04bb82f35000d09464460f49b945776c9 (patch) | |
tree | d544c3a90a5019a543fb77067ed55336b0a2119a | |
parent | 3f4d61f74b71a21ee9c5d6c8acfecb9b7b3b1c90 (diff) | |
download | txr-32e187c04bb82f35000d09464460f49b945776c9.tar.gz txr-32e187c04bb82f35000d09464460f49b945776c9.tar.bz2 txr-32e187c04bb82f35000d09464460f49b945776c9.zip |
matcher: smallest fix for broken test case found.
* share/txr/stdlib/match.tl (compile-atom-match): Do not
express the match for the atom via test-expr. That is
too late. It needs to be a guard in the guard chain.
-rw-r--r-- | share/txr/stdlib/match.tl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/share/txr/stdlib/match.tl b/share/txr/stdlib/match.tl index 8c7a245a..e44e7e64 100644 --- a/share/txr/stdlib/match.tl +++ b/share/txr/stdlib/match.tl @@ -179,7 +179,9 @@ (new compiled-match pattern atom obj-var obj-var - test-expr ^(equal ,obj-var ',atom)))) + guard-chain (list (new match-guard + guard-expr ^(equal ,obj-var ',atom))) + test-expr t))) (typecase atom (vec (if (non-triv-pat-p atom) (compile-vec-match atom obj-var var-list) |