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]

Re: kawa numerics unstable


Here's a test case using the latest rev 6388:

(define denom 10.0)

; ok
(define numer1 0)
(display (/ numer1 denom))

; fails
(let ((numer2 0))
  (display (/ numer2 denom)))

This gives:

#|kawa:1|# Value (10.0) has wrong type (gnu.math.DFloNum) (expected:
integer)
0.0
    at gnu.kawa.lispexpr.LangObjType.coerceIntNum(LangObjType.java:238)
    at atInteractiveLevel$5.run(numtest.scm:8)
    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)
#|kawa:2|# 


On 9/21/09 7:54 AM, "Per Bothner" <per@bothner.com> wrote:

> On 09/20/2009 09:59 AM, Per Bothner wrote:
>> On 09/20/2009 09:48 AM, alex mitchell wrote:
>>> Yes, that's correct - the breakage actually starts from rev 6376. I just
>>> tested with 6375 and my code works. For 6376 I get
>>> java.lang.ClassCastException: java.lang.Integer cannot be cast to
>>> gnu.math.Numeric. I'll try to track this down in my code and see if I can
>>> isolate a test case.
>> 
>> Wait until I've checked some code in. This changes how Numeric gets
>> converted.
> 
> Go ahead - I've checked in what I have so far.



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