Re: Testing the reference implementation
Michael Sperber 20 Nov 2005 15:04 UTC
Bradley Lucier <xxxxxx@math.purdue.edu> writes:
> Thanks. Now in the will package I get the error:
>
> [bradley-luciers-power-mac-g4-cube:~/Desktop/srfi-77/implementation]
> bjlucier% scheme48
> Welcome to Scheme 48 1.3 (made by root on Sat Oct 22 22:26:09 CDT 2005)
> Copyright (c) 1993-2005 by Richard Kelsey and Jonathan Rees.
> Please report bugs to scheme-48xxxxxx@s48.org.
> Get more information at http://www.s48.org/.
> Type ,? (comma question-mark) for help.
>> ,config ,load packages.scm
>> ,in r6rs/will
> r6rs/will> ,open srfi-34
> r6rs/will> (load "complex-test.scm")
> complex-test.scm
> <whole lot of stuff omitted>
> (+ +#{Fx 0}+#{Fx 0}i +#{Fx 0}+#{Fx 0}i) => +#{Fx 0}+#
> {Fx 0}i
> (- +#{Fx 0}+#{Fx 0}i +#{Fx 0}+#{Fx 0}i) => +#{Fx 0}+#
> {Fx 0}i
> (* +#{Fx 0}+#{Fx 0}i +#{Fx 0}+#{Fx 0}i) => +#{Fx 0}+#
> {Fx 0}i
> (/ +#{Fx 0}+#{Fx 0}i +#{Fx 0}+#{Fx 0}i) =>
> Error: contagion error
> ("ERROR")
> ("ERROR")
> #{Procedure 9414 (=/2 in generic-arithmetic/will)}
> (&error)
>
> ???
This error is due to
(/ (make-rectangular (r5rs->number 0) (r5rs->number 1)) (r5rs->number 0))
raising an exception. Your program converts the result into
("ERROR"), which your program then feeds to =. (In PRINT-NUMBER,
expression (= x x).) The error message is admittedly obscure---it
means that there's no way to convert the arguments of = into suitable
numbers.
> On a separate note, when I change (display x) to (display (number-
>>string x)) to get rid of the #{Fx 0}, etc., I get
>
> r6rs/will> (load "complex-test.scm")
> complex-test.scm
> (+ +
> Error: wrong number of arguments
> ('#{Procedure 9676 (number2string in numbers-to-strings)} '#
> {Fx 0} '#{Fx 10})
Bug. Replace the first three code lines in number2string by:
(define (number->string x . more)
(if (null? more)
(number2string x (r5rs->integer 10) #f)
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla