summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-01-09 15:23:46 -0800
committerKaz Kylheku <kaz@kylheku.com>2012-01-09 15:23:46 -0800
commitd8df8beb2e00517a546d753586d67e14ffa4611d (patch)
treef52a9dac50dd69e65f29d23ee966711f601be4f2
parent2098cacb547ba399c879bd53fff8dd5b1408f81f (diff)
downloadtxr-d8df8beb2e00517a546d753586d67e14ffa4611d.tar.gz
txr-d8df8beb2e00517a546d753586d67e14ffa4611d.tar.bz2
txr-d8df8beb2e00517a546d753586d67e14ffa4611d.zip
* eval.c (subst_vars): Evaluate the
modifiers, so expressions can be used. * match.c (subst_vars): Likewise, but using txeval.
-rw-r--r--ChangeLog8
-rw-r--r--eval.c2
-rw-r--r--match.c4
3 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b5343dd8..6f87c46b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-01-09 Kaz Kylheku <kaz@kylheku.com>
+
+ * eval.c (subst_vars): Evaluate the
+ modifiers, so expressions can be used.
+
+ * match.c (subst_vars): Likewise,
+ but using txeval.
+
2012-01-07 Kaz Kylheku <kaz@kylheku.com>
Version 52
diff --git a/eval.c b/eval.c
index 325c4a00..70711b45 100644
--- a/eval.c
+++ b/eval.c
@@ -744,7 +744,7 @@ static val subst_vars(val forms, val env)
if (sym == var_s) {
val sym = second(form);
val pat = third(form);
- val modifiers = fourth(form);
+ val modifiers = eval_args(fourth(form), env, form);
val pair = lookup_var(env, sym);
if (pair) {
diff --git a/match.c b/match.c
index f13b2578..1dece256 100644
--- a/match.c
+++ b/match.c
@@ -1277,6 +1277,10 @@ static val subst_vars(val spec, val bindings, val filter)
val modifiers = fourth(elem);
val pair = assoc(sym, bindings);
+ if (modifiers)
+ modifiers = mapcar(curry_123_2(func_n3(txeval), spec, bindings),
+ modifiers);
+
if (pair) {
val str = cdr(pair);