diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-06-02 20:25:31 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-06-02 20:25:31 -0700 |
commit | f386692dede859e99745dae25a8f61cb1d39d940 (patch) | |
tree | 12d42f0a9aeab4f790c786a72d0dcef8f29604b9 /itypes.c | |
parent | d178ddaac5b58c3a0d8b024884859d7ef3c24386 (diff) | |
download | txr-f386692dede859e99745dae25a8f61cb1d39d940.tar.gz txr-f386692dede859e99745dae25a8f61cb1d39d940.tar.bz2 txr-f386692dede859e99745dae25a8f61cb1d39d940.zip |
matcher: quasiquote matching.
This allows
(when-match ^(,a ,b) '(1 2) (list a b)) -> (1 2)
which is a nice alternative that is supported by some
Lisp pattern matchers. We don't need it since we have (@a @b).
The motivation is JSON matching.
(when-match ^#J{"foo" : {"x" : ~val}}
#J{"foo" : {"x" : "y"}} val)
-> "y"
* share/txr/stdlib/match.tl (compile-match): Recognize qquote
case and handle via transform-qquote function.
(non-triv-pat-p): Let's declare quasiquotes to be nontrivial.
(transform-qquote): New function: transform quasi-quoted
syntax into regular pattern matching syntax.
* txr.1: Documented.
Diffstat (limited to 'itypes.c')
0 files changed, 0 insertions, 0 deletions