From 483e15d9af31110d2a34ad20fe010663de5afe19 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 13 Aug 2021 06:25:50 -0700 Subject: matcher: new must-match and must-match-case macros. * lisplib.c (match_set_entries): Intern the match-error symbol. Register autoloads for must-match and must-match-case. * stdlib/match.tl (match-error): Register exception symbol, as subtype of match-error. (must-match, must-match-case): New macros. * tests/011/patmatch.tl: Test cases. * txr.1: Documented. --- lisplib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisplib.c') diff --git a/lisplib.c b/lisplib.c index 86f20ab1..d777c717 100644 --- a/lisplib.c +++ b/lisplib.c @@ -877,11 +877,12 @@ static val match_instantiate(val set_fun) static val match_set_entries(val dlt, val fun) { val name_noload[] = { - lit("all*"), lit("as"), lit("with"), lit("scan"), lit("sme"), + lit("all*"), lit("as"), lit("with"), lit("scan"), lit("sme"), lit("match-error"), nil }; val name[] = { - lit("when-match"), lit("match-case"), lit("if-match"), + lit("when-match"), lit("match-case"), lit("if-match"), lit("must-match"), + lit("must-match-case"), lit("while-match"), lit("while-match-case"), lit("while-true-match-case"), lit("lambda-match"), lit("defun-match"), lit("defmatch"), lit("each-match"), lit("append-matches"), -- cgit v1.2.3