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

Re: [Scheme-reports] current-posix-second is a disastrous mistake



Alex Shinn scripsit:

> The intent was that `current-posix-seconds' can be easily implemented
> in terms of `current-tai-seconds'.  Other instances of POSIX time such
> as found in timestamps and timers can also be converted.

In practice, current-tai-seconds will be implemented in terms of
current-posix-seconds, since that's what's universally available.
Why deny this reality?  Making current-tai-seconds the core procedure
*compels* one to keep around the TAI-UTC conversion table.

> If you want to work with calendar datetimes then you shouldn't be
> converting them to seconds at all.

If you are working with non-Gregorian calendars, you need to be able
to pivot date-time values through something, and a count of calendrical
seconds is a very sensible option.

> Why are you trying so hard to put such strange words into my mouth?
> What datetime class have you ever seen which uses TAI seconds as one
> of the fields?  A datetime class has year, month, day, hour, minute,
> second, etc. as you yourself said above.

As you can see at TimeAdvancedCowan, my date objects have whatever fields
the chronology object thinks they should have, and it assumes a constraint
framework that calculates some fields from others.  The maya-long-count
calendar will presumably have fields named day-of-uinal, uinal-of-tun,
tun-of-katun, katun-of-baktun, and baktun.

> Please understand, the context of the WG1 discussion is about time,
> not dates.  We want a way to obtain the current time (and in WG1 are
> unlikely to provide anything beyond that).

Which current time?  That's precisely what's under discussion.  If we
are to layer a calendrical system, then we need a close approximation
to calendrical current time; if we need to measure elapsed time, then
we need a close approximation to SI seconds counted from some epoch,
but don't care about the epoch.

TimeCowan provides both of these things.

> The datetime API will be part of WG2, and can be implemented in portable
> Scheme, assuming you have a way to compute the current time.

The current calendrical time, UTC or Posix, that is.

-- 
John Cowan           http://www.ccil.org/~cowan            cowan@x
One of the oil men in heaven started a rumor of a gusher down in hell.  All
the other oil men left in a hurry for hell.  As he gets to thinking about
the rumor he had started he says to himself there might be something in
it after all.  So he leaves for hell in a hurry.    --Carl Sandburg

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports