summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-02-06 06:58:20 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-02-06 06:58:20 -0800
commitee21c61785cead30fb0f1cde1f6fd9900e358268 (patch)
treee00bd6cd6d70802b7f79cd3659e80333d7286377 /eval.c
parentff958087cf0e483ac592dc4c41023165d95f9778 (diff)
downloadtxr-ee21c61785cead30fb0f1cde1f6fd9900e358268.tar.gz
txr-ee21c61785cead30fb0f1cde1f6fd9900e358268.tar.bz2
txr-ee21c61785cead30fb0f1cde1f6fd9900e358268.zip
* eval.c (subst_vars): Bugfix. When an ordinary variable
occurs in the quasi syntax (which is the result of substitution of metanums like @1 by the op macro), if that variable evaluated to a list form, it was not being converted to a string. The resulting form was then examined for variable substitutions as if it were part of the quasi syntax. This was introduced at the same time as the feature of being able to use metanums in a quasiliteral (Feb 13, 2012: last change before Version 57).
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/eval.c b/eval.c
index eaa7960f..87616a08 100644
--- a/eval.c
+++ b/eval.c
@@ -2071,18 +2071,8 @@ static val subst_vars(val forms, val env)
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;
- }
- eval_error(forms, lit("unbound variable ~s"), form, nao);
+ forms = cons(cons(var_s, cons(form, nil)), cdr(forms));
+ continue;
}
iter = list_collect(iter, form);