Timespecs and the comparator Göran Weinholt (13 Nov 2019 16:44 UTC)
Re: Timespecs and the comparator John Cowan (13 Nov 2019 17:25 UTC)
Re: Timespecs and the comparator Lassi Kortela (13 Nov 2019 17:34 UTC)
Re: Timespecs and the comparator John Cowan (13 Nov 2019 18:01 UTC)
Re: Timespecs and the comparator Lassi Kortela (14 Nov 2019 12:18 UTC)

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?