all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* The format of time values in lisp/calendar/time-date.el.
@ 2005-03-14 14:51 Lute Kamstra
  2005-03-14 23:43 ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Lute Kamstra @ 2005-03-14 14:51 UTC (permalink / raw)


The various function in time-date.el seem to use different formats for
their arguments.  According to the node Time Calculations in the Lisp
Manual, the following functions should use the format (HIGH LOW MICRO)
to specify HIGH * 65536 + LOW + MICRO / 1000000 seconds:

- time-less-p
- time-subtract
- time-add
- time-to-days
- time-to-day-in-year

However, in reality:

- time-less-p expects (HIGH LOW) for its arguments
- time-subtract expects (HIGH LOW) for its arguments and returns (HIGH
  LOW) as well
- time-add expects either (HIGH LOW MICRO), (HIGH LOW), or (HIGH .
  LOW) and returns (HIGH LOW MICRO).
- time-to-days and time-to-day-in-year use decode-time on its argument.
  decode-time expects (HIGH LOW . IGNORED) or (HIGH . LOW).

Was there an evolution in format from (HIGH . LOW), via (HIGH LOW), to
(HIGH LOW MICRO)?

Shall I fix time-less-p and time-subtract to deal with (HIGH LOW
MICRO) arguments as well?

Should they deal with (HIGH . LOW) too?

What about the return value of time-subtract (and time-add): should it
be backward compatible in the sense that it returns (HIGH LOW) if both
its arguments are of that format?

Lute.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-03-16 17:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-14 14:51 The format of time values in lisp/calendar/time-date.el Lute Kamstra
2005-03-14 23:43 ` Richard Stallman
2005-03-16 17:01   ` Lute Kamstra

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.