This is the mail archive of the kawa@sources.redhat.com 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: arith. expression crashes Kawa


Sven.Hartrumpf@fernuni-hagen.de wrote:
With current CVS version of kawa, I get the following strange behavior:

#|kawa:4|# (quotient (+ (quotient (* 95 1000 10) 100) 5) 10)
950                  ; fine

#|kawa:5|# (define quotient-fix (lambda (a b x) (quotient (+ (quotient (* a x 10) b) 5) 10))) ; let's use a generalized expression as a function definition

#|kawa:6|# (quotient-fix 95 100 1000)
Argument #0 to 'quotient' has wrong type
        at gnu.mapping.WrongType.make(WrongType.java:56)
> ...

I'ld wager that is a consequence of this change:

cvs diff -D 2003-08-19 kawa/lib/numbers.scm

34,38c35,54
< (define (quotient (x :: <integer>) (y :: <integer>)) :: <integer>
<   (invoke-static <integer> 'quotient x y))
<
< (define (remainder (x :: <integer>) (y :: <integer>)) :: <integer>
<   (invoke-static <integer> 'remainder x y))
---
> (define (quotient (x :: <real>) (y :: <real>)) :: <real>
>   (if (and (instance? x <integer>) (instance? y <integer>))
>       (invoke-static <integer> 'quotient x y)
>       (invoke (/ x y) 'toInt (static-field <number> 'TRUNCATE))))
>

There are other related changes on 2003-08-20 but this seems the most likely culprit. I'm not sure what should be going on here or what a good workaround is (other than reverting to an earlier version). I first tried just reverting the changes in kawa/standard (based on the top-level Changelog entry which didn't say gnu/math or kawa/lib changed) but that wasn't it.

cvs rdiff -s -D 2003-08-19 -D 2003-08-22 kawa
File kawa/ChangeLog changed from revision 1.371 to 1.373
File kawa/doc/ChangeLog changed from revision 1.103 to 1.104
File kawa/doc/kawa.texi changed from revision 1.137 to 1.138
File kawa/gnu/expr/ApplyExp.java changed from revision 1.61 to 1.62
File kawa/gnu/expr/ChangeLog changed from revision 1.262 to 1.263
File kawa/gnu/kawa/functions/AddOp.java changed from revision 1.10 to 1.11
File kawa/gnu/kawa/functions/ChangeLog changed from revision 1.51 to 1.52
File kawa/gnu/kawa/functions/DivideOp.java changed from revision 1.1 to 1.2
File kawa/gnu/kawa/lispexpr/ChangeLog changed from revision 1.38 to 1.40
File kawa/gnu/kawa/lispexpr/LispReader.java changed from revision 1.11 to 1.13
File kawa/gnu/math/ChangeLog changed from revision 1.62 to 1.64
File kawa/gnu/math/Complex.java changed from revision 1.9 to 1.10
File kawa/gnu/math/DComplex.java changed from revision 1.8 to 1.9
File kawa/gnu/math/DQuantity.java changed from revision 1.6 to 1.7
File kawa/gnu/math/IntNum.java changed from revision 1.44 to 1.45
File kawa/gnu/math/MulUnit.java changed from revision 1.5 to 1.6
File kawa/gnu/math/Quantity.java changed from revision 1.8 to 1.9
File kawa/gnu/math/RealNum.java changed from revision 1.14 to 1.15
File kawa/gnu/math/Unit.java changed from revision 1.12 to 1.13
File kawa/kawa/lib/ChangeLog changed from revision 1.101 to 1.102
File kawa/kawa/lib/numbers.scm changed from revision 1.13 to 1.15
File kawa/kawa/standard/Makefile.am changed from revision 1.95 to 1.96
File kawa/kawa/standard/Makefile.in changed from revision 1.115 to 1.116
File kawa/kawa/standard/Scheme.java changed from revision 1.138 to 1.139
File kawa/kawa/standard/modulo.java is removed; not included in release date 2003.08.22.07.00.00
File kawa/kawa/standard/positive_p.java is removed; not included in release date 2003.08.22.07.00.00
File kawa/kawa/standard/string2number.java changed from revision 1.11 to 1.12
File kawa/testsuite/ChangeLog changed from revision 1.122 to 1.123
File kawa/testsuite/num-test.scm changed from revision 1.13 to 1.14
File kawa/testsuite/test.scm changed from revision 1.9 to 1.10


Jim
--
"I love deadlines. I love the whooshing sound they make as they fly by." -- Douglas Adams



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