Re: Testing the reference implementation Michael Sperber 20 Nov 2005 22:36 UTC

Bradley Lucier <xxxxxx@math.purdue.edu> writes:

> First of all, the first argument here is supposed to be +0+1i; why
> it's printing as +0+0i I don't know.
>
> Secondly, I don't know why the result of the expression does not
> compare eq? to error-object; ("ERROR")  shouldn't be passed to print-
> number in any case.  I get the same results when I test it with equal?.

The reason is that you're assuming a semantics for
WITH-EXCEPTION-HANDLER which the SRFI 34 version of it doesn't have:
It doesn't throw back to the call of WITH-EXCEPTION-HANDLER when an
exception occurs.  Consequently, you get ("ERROR") objects thrown deep
into the innards of the reference implementation, and that makes it
gag, and, subsequently, less than articulate.

You probably want something like:

   (let ((result
            (guard
             (exc
              (else error-object))
             (operation first-arg second-arg))))
     ...)

in its place.

Having said that, your test program spotted a few more typos after
this change---thanks for that!  I've put an updated reference
implementation up at the SRFI site which fixes at least the most
obvious ones.

--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla