On Tue, Sep 17, 2019 at 7:39 AM Lassi Kortela <xxxxxx@lassi.io> wrote:
 
Thanks for drafting this SRFI, John. Well written.

Thanks.
 
"(timespec? obj) [...] each component is checked to see if it is an
exact integer, and in the case of the nanoseconds component, whether it
is a non-positive integer less than 1,000,000,000."

Means to say "non-negative integer".

Will fix.
 
It might be good to add an explicit discussion of negative values to the
Rationale section. The definition of the (timespec?) procedure implies
that the seconds component can be negative, but nanoseconds cannot.
However, this doesn't seem to be explicitly stated anywhere.


You're right; I'll fix that.  I'm also going to add that the constructor arguments and acessor results are exact integers, and that what comes out the accessor must be eqv? to what  went into the constructor, as is normal in Scheme.  That rules out a float64 representation, as they are only accurate to the nearest nanosecond for 2^23 seconds after the Epoch, which is July 1970 for the Posix epoch.

It might also be good to add an explicit statement that if the
implementation's fixnum length is >= N bits, then it is permitted to
regard any object with timespec-like structure but bignum instead of
fixnum values as not being a timespec. Stipulating N = 30 bits gives a
billion years of range.

Unfortunately the largest number *guaranteed* to be a fixnum is 2^23-1 per R6RS and SRFI 143, which  allows up to a byte of tag but seriously limits the range, as seen above.


John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
Mark Twain on Cecil Rhodes: I admire him, I freely admit it,
and when his time comes I shall buy a piece of the rope for a keepsake.