[Top][All Lists]

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

Re: Decoded time accessors

From: Lars Ingebrigtsen
Subject: Re: Decoded time accessors
Date: Sun, 07 Jul 2019 22:09:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Paul Eggert <address@hidden> writes:

> Lars Ingebrigtsen wrote:
>> I hate reading code that says (elt decoded 5) and then
>> have to look up the doc string and then count to be able to tell what
>> it's doing
> I dislike that too. Luckily, it doesn't happen too often for me. I try
> to avoid it by using format-time-string instead of decode-time.

Yup, but when writing code to manipulate times, it's often easier to
work on the decoded time instead of manipulating the other time forms.
(For instance, getting "next day at the same time" is much easier in
decoded time, because that can be 23, 24 or 25 hours depending on

> What do Common Lisp hackers do? Common Lisp has a similar function
> decode-universal-time, so they must have a similar problem.

Yup.  I can only speak for myself, and we ended up with similar things
to what I'm proposing, only...  more organically grown over the years.

> Where in the source code would you put the accessors?

I was looking around in the tree, and I haven't really found a good
place to put them...  parse-time.el isn't basic enough, and the really
base time functions are in C.  So...  perhaps simple.el?  Or a new file,

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

[Prev in Thread] Current Thread [Next in Thread]