summaryrefslogtreecommitdiffstats
path: root/lisplib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-17 19:21:53 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-17 19:21:53 -0700
commitb987a3d6fefbd31f11d7f500b259a26a0d33bd80 (patch)
tree843bcabb16d95d16a9ae8afaad4434f3efada191 /lisplib.c
parentaf09cb0e30fd40250a0d74f5effc14713eba23bd (diff)
downloadtxr-b987a3d6fefbd31f11d7f500b259a26a0d33bd80.tar.gz
txr-b987a3d6fefbd31f11d7f500b259a26a0d33bd80.tar.bz2
txr-b987a3d6fefbd31f11d7f500b259a26a0d33bd80.zip
matcher: allow user-defined patterns via defmatch
* lisplib.c (match_set_entries): Register defmatch and *match-symbol* to autoload match.tl. * share/txr/stdlib/doc-syms.tl: Updated with entries for defmatch and *match-macro*. * share/txr/stdlib/match.tl (*match-macro*): New special variable holding hash. (compile-match): Handle macros via *match-macro* hash. (defmatch): New macro. * txr.1: Documented. * tags.tl: Recognize defmatch forms.
Diffstat (limited to 'lisplib.c')
-rw-r--r--lisplib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisplib.c b/lisplib.c
index c37cb4a5..a8e8c8de 100644
--- a/lisplib.c
+++ b/lisplib.c
@@ -876,7 +876,8 @@ static val match_set_entries(val dlt, val fun)
};
val name[] = {
lit("when-match"), lit("match-case"), lit("if-match"),
- lit("lambda-match"), lit("defun-match"),
+ lit("lambda-match"), lit("defun-match"), lit("defmatch"),
+ lit("*match-macro*"),
nil
};
val match_k = intern(lit("match"), keyword_package);