summaryrefslogtreecommitdiffstats
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
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).
-rw-r--r--ChangeLog12
-rw-r--r--eval.c14
2 files changed, 14 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index c0c4953f..474d65eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2015-02-06 Kaz Kylheku <kaz@kylheku.com>
+ * 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).
+
+2015-02-06 Kaz Kylheku <kaz@kylheku.com>
+
* eval.c (transform_op): When expanding @rest and metanums
like @1, @2, preserve the (sys:var X args ..) structure
if there are args (but of course with X replaced by the appropriate
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);