summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 07c7fc1c..380b4623 100644
--- a/eval.c
+++ b/eval.c
@@ -1117,6 +1117,20 @@ static val subst_vars(val forms, val env)
forms = cdr(forms);
continue;
}
+ } else if (bindable(form)) {
+ val pair = lookup_var(env, form);
+
+ if (pair) {
+ val str = cdr(pair);
+
+ if (!stringp(str) && !listp(str))
+ str = format(nil, lit("~a"), str, nao);
+
+ forms = cons(str, rest(forms));
+ continue;
+ }
+ uw_throwf(query_error_s, lit("unbound variable ~a"),
+ form, nao);
}
list_collect(iter, form);