emacs-devel
[Top][All Lists]
Advanced

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

Re: encode-time vs decode-time


From: Stefan Monnier
Subject: Re: encode-time vs decode-time
Date: Sat, 17 Aug 2019 17:42:42 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> The POSIX identifier for broken-down time is 'tm', as in 'struct tm'. We
> could steal that identifier too, e.g., (tm-seconds time), (tm-zone time),
> etc. Again, not ideal, but perhaps better than (broken-down-seconds
> time). If the prefix 'tm-' is too short, we could expand it to 'time-tm-' or
> something like that.

FWIW, I think neither "broken down time" nor "tm" are significantly less
bad than "decoded-time", so I don't think it's worth changing the term
we've been using.

I think part of the problem is that an "encoded time" object looked like
"a list of integers" and a "decoded time" object looked like "a list of
integers".  As we move the "decoded time" objects closer to actual
structs and the "encoded time" objects closer to plain (rational)
numbers, things should get more clear.

So maybe we should stop documenting "decoded time" objects as being of
the form (SEC MINUTE HOUR DAY MONTH YEAR DOW DST UTCOFF SUBSEC), but
instead say that it's a `decoded-time` object on which you can use
the `decoded-time-*` accessors (and provide a corresponding pcase pattern
to replace the `(,sec ,minute ...) one).


        Stefan




reply via email to

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