diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-12-26 21:16:35 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-12-26 21:16:35 -0800 |
commit | 1a591b04b32d9bca406a338c1377aa4526492eaf (patch) | |
tree | 6d88912d232ebcc1f10037324ff34dab71ca2902 /match.c | |
parent | 837b0f15d86b21665fdf7c5d55cbe4ecd6d42ea4 (diff) | |
download | txr-1a591b04b32d9bca406a338c1377aa4526492eaf.tar.gz txr-1a591b04b32d9bca406a338c1377aa4526492eaf.tar.bz2 txr-1a591b04b32d9bca406a338c1377aa4526492eaf.zip |
Allow @(repeat) and @(rep) to see Lisp globals.
* match.c (extract_bindings): Process the final list of vars.
For any variable not already on the list of output bindings,
check if it has a Lisp binding, and if so, add *that* binding
to the output bindings.
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1675,6 +1675,17 @@ static val extract_bindings(val bindings, val output_spec, val vars) ptail = list_collect(ptail, binding); } + for (; var_list; var_list = cdr(var_list)) { + val sym = car(var_list); + if (assoc(sym, bindings_out)) { + continue; + } else { + val binding = lookup_var(nil, sym); + if (binding) + ptail = list_collect(ptail, binding); + } + } + return bindings_out; } |