summaryrefslogtreecommitdiffstats
path: root/lisplib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-01-15 06:42:53 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-01-15 06:42:53 -0800
commit68ac0d194820fe9091fb4720b74ed1782767daee (patch)
tree7477aed5e7e099c21eeccc0a2d3706127027f0dc /lisplib.c
parent8dd229be2aedaf93d92f5515bc40c86cd9942a4d (diff)
downloadtxr-68ac0d194820fe9091fb4720b74ed1782767daee.tar.gz
txr-68ac0d194820fe9091fb4720b74ed1782767daee.tar.bz2
txr-68ac0d194820fe9091fb4720b74ed1782767daee.zip
matcher: fix semantics of empty @(all ...) match.
* lisplib.c (match_set_entries): Ensure usr:all* is interned. * share/txr/stdlib/match.tl (compile-all-match): When the operator is the existing all, we must listp as a guard, not consp, because an empty list must match vacuously by virtue of not containing any counterexample to the pattern. For situations when a vacuous empty match is not desired, we support the all* alternative operator, which uses consp. (compile-match): Wire in the all* operator.
Diffstat (limited to 'lisplib.c')
-rw-r--r--lisplib.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisplib.c b/lisplib.c
index a77ff015..fa6022de 100644
--- a/lisplib.c
+++ b/lisplib.c
@@ -869,11 +869,17 @@ static val match_instantiate(val set_fun)
static val match_set_entries(val dlt, val fun)
{
+ val name_noload[] = {
+ lit("all*"),
+ nil
+ };
val name[] = {
lit("when-match"),
nil
};
+
set_dlt_entries(dlt, name, fun);
+ intern_only(name_noload);
return nil;
}