unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lute Kamstra <Lute.Kamstra.lists@xs4all.nl>
Subject: The format of time values in lisp/calendar/time-date.el.
Date: Mon, 14 Mar 2005 15:51:35 +0100	[thread overview]
Message-ID: <873buy7020.fsf@xs4all.nl> (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.

             reply	other threads:[~2005-03-14 14:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-14 14:51 Lute Kamstra [this message]
2005-03-14 23:43 ` The format of time values in lisp/calendar/time-date.el Richard Stallman
2005-03-16 17:01   ` Lute Kamstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873buy7020.fsf@xs4all.nl \
    --to=lute.kamstra.lists@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).