[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: duplication of SRFIs




Alex Shinn wrote:
> It claims to be lightweight yet adds a
> CHECK-EC form, which is unnecessary, pulls in a requirement for
> SRFI-42, and doesn't seem to offer much more than running tests
> inside an existing comprehension available once you are using
> SRFI-42.

Did I miss something in SRFI 42? Where does it define CHECK-EC?

I can tell you from experience: CHECK-EC is worth every penny.

It also does not pull in a dependency on SRFI 42, because CHECK-EC
can be implemented as a hygienic macro which is independent of
anything SRFI 42 defines. In other words, if you do not intend to use
CHECK-EC you do not have to load SRFI 42 at all. If you intend to use
CHECK-EC you need to load SRFI 42 or reimplement the parts you need.

> In exchange it removes any handling of exceptions, which
> seems to be rather crippling for a test SRFI.

This is indeed the biggest limitation of this SRFI: You cannot run checks
that are expected to raise an error conditions, e.g. (check (/ 1 0) => division-by-zero)

However, I decided that the fact R5RS leaves error handling undefined
means that it is not the right time to impose some particular representation
of error conditions on Scheme just for the purpose of this simple SRFI.

In practice, it is not too much of a problem, exactly because portable
working programs do not rely on error conditions---and if they use
exceptions explicitly (e.g. through SRFI 34) so can the test cases:
(check (with-exception-handler ... ) => caught-it).

Sebastian.