This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Numeric error
- From: alex mitchell <lexaay at gmail dot com>
- To: "kawa at sources dot redhat dot com" <kawa at sources dot redhat dot com>
- Date: Wed, 30 Sep 2009 19:52:09 +0800
- Subject: Numeric error
Sorry, another numeric error. This code:
(define a 1.0)
(let ((b (* a 1.0)))
(display b))
gives the following exception:
#|kawa:1|# Value (1.0) for variable 'b' has wrong type (java.lang.Double)
(java.lang.Double)
at atInteractiveLevel$3.run(numtest3.scm:3)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:298)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:176)
at kawa.Shell.run(Shell.java:273)
at kawa.standard.load.loadSource(load.java:115)
at kawa.standard.load.apply(load.java:236)
at kawa.standard.load.apply(load.java:179)
at kawa.standard.load.apply2(load.java:154)
at kawa.standard.load.apply1(load.java:145)
at gnu.mapping.Procedure.apply(Procedure.java:120)
at gnu.mapping.Procedure.apply(Procedure.java:103)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:251)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:355)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:176)
at kawa.Shell.run(Shell.java:273)
at kawa.Shell.run(Shell.java:184)
at kawa.Shell.run(Shell.java:165)
at kawa.repl.processArgs(repl.java:346)
at kawa.repl.main(repl.java:762)
Caused by: java.lang.ClassCastException: java.lang.Double
... 19 more
Note that moving a into the let, ie.:
(let* ((a 1.0)
(b (* a 1.0)))
(display b))
works as expected.
This is using kawa 1.9.90 rev 6397, java version "1.5.0_20", under MacOSX
10.5.8. This error did not appear in rev 6388, and seems to have appeared in
rev 6389 onwards.
Alex