From 1a591b04b32d9bca406a338c1377aa4526492eaf Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 26 Dec 2015 21:16:35 -0800 Subject: 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. --- match.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/match.c b/match.c index 68f228ec..2995aca6 100644 --- a/match.c +++ b/match.c @@ -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; } -- cgit v1.2.3