This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]