diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-03-23 07:37:57 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-03-23 07:37:57 -0700 |
commit | d2516225e7e8d5b3aeb5fed3c38d8c47523fd634 (patch) | |
tree | 1fb96bf438be30420dcc50f376b9e5d4996a8aae /struct.c | |
parent | 32ebbda6077e68f3633171a43130dd0194123d6d (diff) | |
download | txr-d2516225e7e8d5b3aeb5fed3c38d8c47523fd634.tar.gz txr-d2516225e7e8d5b3aeb5fed3c38d8c47523fd634.tar.bz2 txr-d2516225e7e8d5b3aeb5fed3c38d8c47523fd634.zip |
match: support @nil in predicates.
For instance @(<= 10 @nil 20) is a pattern which matches
a number between 10 and 20, without binding a variable.
* stdlib/match.tl (compile-predicate-match): Looks like
this code was already halfway expressing the intent that
the avar could be nil, because arg-var takes the value
of avar if that is non-nil, otherwise a gensym is
substituted. What was missing was that the gensym that
replaces nil must also be substituted into the predicate.
* tests/011/patmatch.tl: New tests.
* txr.1: Document that the variable embedded in a
predicate may be null.
Diffstat (limited to 'struct.c')
0 files changed, 0 insertions, 0 deletions