Re: Timespecs and the comparator
Lassi Kortela 13 Nov 2019 17:34 UTC
> I agree that it's too big a dependency and probably shouldn't be there.
I'm neutral on that.
> adding timespec=, timespec<, and friends
Since several Schemes will hopefully have a fast opaque timespec type,
these would be a good idea.
> timespec->inexact and for completeness inexact->timespec
Would these convert between timespecs and floats (where the integer part
is seconds relative to the epoch)? May be a good idea.
As discussed on the SRFI 170 mailing list, Gambit has an opaque time
type as well as `time->seconds` and `seconds->time` procedures for
converting to/from ordinary floats. So it would be easy to convert a
timespec into a time object with (seconds->time (timespec->inexact ts))
and vice versa. Of course, Gambit could provide faster `timespec->time`
and `time->timespec` procedures as well.
Maybe `timespec->seconds` and `seconds->timespec` would be more obvious
names for the SRFI?