[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Slib-discuss] Several (minor) glitches in testing format feature.
From: |
Aubrey Jaffer |
Subject: |
Re: [Slib-discuss] Several (minor) glitches in testing format feature. |
Date: |
Sun, 14 Dec 2008 22:32:30 -0500 (EST) |
| From: Kris De Volder <address@hidden>
| Date: Sun, 14 Dec 2008 15:20:40 -0800
|
| On Sat, 2008-12-13 at 22:18 -0500, Aubrey Jaffer wrote:Not as I read R4RS:
| >
| > ...
|
| I agree your reading, where the "encouraged but not required"
| doesn't apply to this section, makes more sense. So a fixnum
| implementation of / is then required to return exact results when
| possible and only should signal an error for things like (/ 3 2)
| which don't have an exact integer result.
|
| If this is the right interpretation, perhaps another test or two
| should be added to r4rstest.scm. (e.g (/ 6 2) => 3)
Done.
| > | 2) test in formattst.scm that test flonums without checking
| > | they are supported by the implementation:
| > |
| > | (load "formatst.scm")
| > | ...
| > | error at line: 82 col: 1 in
| > | file:/home/kdvolder/workspaces/kscheme/ca.kscheme/bin/slib/formatst.scm
| > | (test '("~a" -1.2) "-1.2")
| > |
| > | I propose to change this line to:
| > | (if format:floats (test '("~a" -1.2) "-1.2"))
| >
| > But the implementation will still choke reading -1.2. I think it
| > needs to be:
| >
| > (if format:floats (test '("~a" (string->number "-1.2")) "-1.2"))
|
| Even better. My reader "accidentally" parses -1.2 as something (not
| a number) but this is really idiosyncratic.
There are many more floating-point literals in "formatst.scm" which
are syntax errors for an exacts-only implementation. "formatst.scm"
is for testing "format.scm", not for testing any sort of
implementation compliance.
Note that running "formatst.scm" on an exacts-only implementation
yields significantly less test coverage than running "formatst.scm" in
an implementation with inexacts. If someone sends me a "formatst.scm"
so wrapped, I will update SLIB; but I am not interested in doing this
gilding myself.
| > | 3) version discrepancy with sc4opt.scm?
| > | ...
|
| Thanks for clearing that up.
|
| I'll summarize for the list: (correct me if I'm reading this wrong)
|
| - The fact that the sc4 tests aren't run by default is so that the
| test can be used for testing IEEE scheme compliant implementations.
|
| - To be slib compatible however, an implementation must be fully
| R4RS compliant and it *must* pass the sc4 tests.
I agree.