aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-01-25 05:21:41 +0000
committerdos-reis <gdr@axiomatics.org>2008-01-25 05:21:41 +0000
commit82b4511dffa72a7521bd751ccb7d220ed4f2f7ae (patch)
tree57de30c4d1472a7b0e41275f9f5c01fd82516684
parent3457ed0779198d8ecec53f4c80b97313e82fdc11 (diff)
downloadopen-axiom-82b4511dffa72a7521bd751ccb7d220ed4f2f7ae.tar.gz
Fix AW/272
* interp/i-spec1.boot (compileADEFBody): Don't evaluate unnamed functions. Compile them instead. * testsuite/interpreter/aw-272.input: New.
-rw-r--r--src/ChangeLog7
-rw-r--r--src/interp/i-spec1.boot4
-rw-r--r--src/testsuite/interpreter/aw-272.input18
3 files changed, 27 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bd8b57bf..86066b4d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2008-01-24 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ Fix AW/272
+ * interp/i-spec1.boot (compileADEFBody): Don't evaluate unnamed
+ functions. Compile them instead.
+ * testsuite/interpreter/aw-272.input: New.
+
2008-01-22 Gabriel Dos Reis <gdr@cs.tamu.edu>
* algebra/any.spad.pamphlet (empty$Scope): Use literal empty list.
diff --git a/src/interp/i-spec1.boot b/src/interp/i-spec1.boot
index 9190d67d..14c28dcd 100644
--- a/src/interp/i-spec1.boot
+++ b/src/interp/i-spec1.boot
@@ -178,8 +178,8 @@ compileADEFBody(t,vars,types,body,computedResultType) ==
--
-- MCD 13/3/96
if not $definingMap and ($genValue or $compilingMap) then
- fun := ["function",["LAMBDA",[:vars,'envArg],body]]
- code := wrap timedEVALFUN ['LIST,fun]
+ fun := [$mapName,["LAMBDA",[:vars,'envArg],body]]
+ code := wrap compileInteractive fun
else
$freeVariables := []
$boundVariables := [minivectorName,:vars]
diff --git a/src/testsuite/interpreter/aw-272.input b/src/testsuite/interpreter/aw-272.input
new file mode 100644
index 00000000..1d81fe00
--- /dev/null
+++ b/src/testsuite/interpreter/aw-272.input
@@ -0,0 +1,18 @@
+++ Contributed by <unknown>
+-- Issue: variables local to unnamed functions incorrectly handled.
+
+f x ==
+ a := 3
+ x + a
+
+f 3
+
+
+g := x +-> (x+2 ; x+a)
+
+g 3
+
+h := x +-> (a := 3 ; x+a)
+
+h 3
+