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: Lars Ingebrigtsen
Subject: Re: encode-time vs decode-time
Date: Tue, 30 Jul 2019 12:32:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> I think we should clarify:
>
> - "time string", as returned by format-time-string and accepted
>   by parse-time-string.
>
> - "decoded time", i.e. a list of the form (SECOND MINUTE HOUR DAY MONTH YEAR 
> IGNORED DST ZONE)
>   I just pushed a patch which defines the `decoded-time` *type*, so we can
>   refer to that precise name in docstrings.

Makes sense.

> - "time counted in seconds" for which we support several representations:
>   a plain number, a list of integers (HIGH LOW USEC PSEC), a pair of
>   integers (NUMERATOR . DENOMINATOR).
>
> And part of the confusion for me is that `encode-time` not only encodes
> time, but can also be used to convert between different representations
> of "time counted in seconds" (in which case it's not the inverse of
> decode-time).

Yes, that's something that I think was added by Paul late last year, and
which I think was a mistake, because it makes things conceptually
confusing.

I think the stuff to convert between the various "time counted in
seconds" stuff should be a separate function, because it has nothing to
do with "decoded time".

-- 
(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]