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

Re: SRFI-19 reference implementation problem



A new fixed version is up at:

http://max.cs.kzoo.edu/~wfitzg/srfi-19/

These are based on Martin Gasbichler's comments, which I address below.


Martin Gasbichler asks, and I answer:

Some small remarks I came across while porting this to scsh:

Why not using SRFI-9 for the definition of the record types? This
would it also make possible omit the definition of mutators completely
instead of redefining them to throw an error.

I tried to make as few assumptions about the implementation as possible, especially because some parts of the code are OS-specific.


Why is the definition of COPY-TIME not simply:

(define (copy-time time)
   (make-time (time-type time)
              (time-second time)
              (time-nanosecond time)))


Sometimes, I'm an idiot. I fixed this.


/ with more than two arguments is an optional procedure in R5RS, same
applies to -. IMHO using the binary variants makes the code much more
readable...


Hmm, we could quibble on the readability, but for max. portability of this less than portable code, I've changed calls to / and - to 1 or 2 arguments. I think there was only one arity three call for each.

Scsh's reader is case-sensitive, it therefore fails to understand
#\Space. Also #\Tab or #\tab is not in R5RS, maybe you could use a
string containing a tabulator character instead (for the scsh port I
used scsh's ASCII package).


No #\tab character in R5RS! Argh! I changed this to (integer->char 9) and
hope for ascii or equivalents.

The scsh version of your code with these things fixed is available
from scsh's CVS at

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/scsh/scsh- 0.6/scheme/srfi/srfi-19.scm?rev=HEAD&content-type=text/plain


Before successfully running the test suite I had to fix two minor
tweaks:

In the test suite you use the non-standard |...| notation for
symbols.

OK, I changed this in my code, too.


Also in the test suite you use tm:nano which is obviously an internal
constant of the library.

OK, I changed this in my code, too.


--
Will Fitzgerald