diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-08-13 06:25:50 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-08-13 06:25:50 -0700 |
commit | 483e15d9af31110d2a34ad20fe010663de5afe19 (patch) | |
tree | 6721ce5ccadde9b844ec674bff3145941fa0da17 /lisplib.c | |
parent | 3d7e614022c19d0c42ff32d60c8e51b226fb427d (diff) | |
download | txr-483e15d9af31110d2a34ad20fe010663de5afe19.tar.gz txr-483e15d9af31110d2a34ad20fe010663de5afe19.tar.bz2 txr-483e15d9af31110d2a34ad20fe010663de5afe19.zip |
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.
Diffstat (limited to 'lisplib.c')
-rw-r--r-- | lisplib.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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"), |