This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: fluid-let problem
- From: Per Bothner <per at bothner dot com>
- To: Wen-Chun Ni <wcn at tbcommerce dot com>
- Cc: kawa at sources dot redhat dot com
- Date: Sun, 10 Nov 2002 13:42:37 -0800
- Subject: Re: fluid-let problem
- References: <20021109181954.A12675@tbcommerce.com>
Wen-Chun Ni wrote:
#|kawa:1|# (define x 1)
#|kawa:2|# (define (f y) (+ x y))
#|kawa:3|# (f 1)
2
#|kawa:4|# (fluid-let ((x 2)) (f 1))
java.lang.Error: popType called with empty stack
Thanks for a nice simple test-case. I checked in the
attached patch.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/
Index: FindTailCalls.java
===================================================================
RCS file: /cvs/kawa/kawa/gnu/expr/FindTailCalls.java,v
retrieving revision 1.25
diff -u -r1.25 FindTailCalls.java
--- FindTailCalls.java 26 Sep 2002 21:46:18 -0000 1.25
+++ FindTailCalls.java 10 Nov 2002 21:40:20 -0000
@@ -92,7 +92,16 @@
decl.setCanRead(true);
decl.setCanWrite(true);
}
- return super.walkFluidLetExp(exp);
+ boolean save = inTailContext;
+ inTailContext = false;
+ try
+ {
+ return super.walkFluidLetExp(exp);
+ }
+ finally
+ {
+ inTailContext = save;
+ }
}
protected Expression walkLetExp (LetExp exp)