diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-01-22 18:49:57 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-01-22 18:49:57 -0800 |
commit | 7af73f4d549a25b41e8278a3a26bed3603e31bc1 (patch) | |
tree | 245b1c5823949754367bcc3edaf3416cf7eb4d09 /arith.h | |
parent | 3fb32c9a73d407844fb9f7c843f70f85bee5b60e (diff) | |
download | txr-7af73f4d549a25b41e8278a3a26bed3603e31bc1.tar.gz txr-7af73f4d549a25b41e8278a3a26bed3603e31bc1.tar.bz2 txr-7af73f4d549a25b41e8278a3a26bed3603e31bc1.zip |
matcher: match trivial patterns as atoms.
* share/txr/stdlib/match.tl (compile-atom-match): Test whether
a vector is really a non-trivial pattern, or a trivial
piece of datum. If it is trivial, then compile it
as an atom, which is matched by a simple call to equal,
which is way less code bloat, and implemented in C.
(compile-match): Similarly, check whether the cons structure
case is nontrivial and only then treat it as a cons
pattern, otherwise compile it as an atom, which will
just match it with equal.
Diffstat (limited to 'arith.h')
0 files changed, 0 insertions, 0 deletions