diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-08-19 11:47:12 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-08-19 11:47:12 -0700 |
commit | f374abcd23a63f628a9ec7b84e2d797d3fc28342 (patch) | |
tree | 811149d630ffaefaa8be464465f660ba9287fc98 /stdlib | |
parent | 46be04f43613e08af5015485ff19bb79af1d3feb (diff) | |
download | txr-f374abcd23a63f628a9ec7b84e2d797d3fc28342.tar.gz txr-f374abcd23a63f628a9ec7b84e2d797d3fc28342.tar.bz2 txr-f374abcd23a63f628a9ec7b84e2d797d3fc28342.zip |
matcher: rename error-throwing macros.
* stdlib/match.tl (must-match): Renamed to just match.
It's just when-match without the "when".
(must-match-case): Renamed to match-ecase, consistent
with the case -> ecase naming scheme.
* lisplib.c (match_set_entries): Names updated here.
* tests/011/patmatch.tl: Test cases updated.
* txr.1: Names updated here.
* stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/doc-syms.tl | 10 | ||||
-rw-r--r-- | stdlib/match.tl | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/stdlib/doc-syms.tl b/stdlib/doc-syms.tl index 48eb6624..b9877466 100644 --- a/stdlib/doc-syms.tl +++ b/stdlib/doc-syms.tl @@ -968,7 +968,7 @@ ("ido" "N-011CFC0C") ("iexten" "N-0072FF5E") ("if" "D-001D") - ("if-match" "N-00D595FF") + ("if-match" "N-01BE5C4A") ("ifa" "N-018F39B0") ("iff" "N-000E3A74") ("iffi" "N-000E3A74") @@ -1206,7 +1206,9 @@ ("maprod" "N-015987D7") ("maprodo" "N-015987D7") ("mask" "N-0056CEF1") - ("match-case" "N-00E4CE2A") + ("match" "N-01BE5C4A") + ("match-case" "N-0282196B") + ("match-ecase" "N-0282196B") ("match-fun" "N-033F766A") ("match-regex" "N-02E3A26F") ("match-regex-right" "N-019430C5") @@ -1253,8 +1255,6 @@ ("mode-t" "N-01D716FE") ("multi" "N-034946BA") ("multi-sort" "N-0132852F") - ("must-match" "N-00D595FF") - ("must-match-case" "N-00E4CE2A") ("n-choose-k" "N-02ACFDE6") ("n-perm-k" "N-02ACFDE6") ("name" "N-01557906") @@ -2058,7 +2058,7 @@ ("wait" "N-0365C3E1") ("weave" "N-0208F32F") ("when" "N-017EFAB6") - ("when-match" "N-00D595FF") + ("when-match" "N-01BE5C4A") ("whena" "N-005C93DF") ("whenlet" "N-02DA21F6") ("where" "N-0208F1DE") diff --git a/stdlib/match.tl b/stdlib/match.tl index 81f8d8a7..30389ce1 100644 --- a/stdlib/match.tl +++ b/stdlib/match.tl @@ -645,12 +645,12 @@ ,result ,else))))) -(defmacro must-match (pat obj . body) +(defmacro match (pat obj . body) (with-gensyms (val) ^(let ((,val ,obj)) (if-match ,pat ,val (progn ,*body) - (throwf 'match-error "~s: ~s failed to match object ~s" 'must-match ',pat ,val))))) + (throwf 'match-error "~s: ~s failed to match object ~s" 'match ',pat ,val))))) (defmacro while-match (:form *match-form* :env e pat obj . body) (let ((cm (compile-match pat : (get-var-list e)))) @@ -683,11 +683,11 @@ (or ,*clause-code) ,result-temp)))) -(defmacro must-match-case (obj . clauses) +(defmacro match-ecase (obj . clauses) (with-gensyms (else) ^(match-case ,obj ,*clauses - ((var ,else) (throwf 'match-error "~s: failed to match object ~s" 'must-match-case ,else))))) + ((var ,else) (throwf 'match-error "~s: failed to match object ~s" 'match-ecase ,else))))) (defmacro while-match-case (:form *match-form* :env e obj . clauses) (unless [all clauses [andf proper-listp [chain len plusp]]] |