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: Paul Eggert
Subject: Re: encode-time vs decode-time
Date: Sat, 17 Aug 2019 15:53:13 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Stefan Monnier wrote:
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'm starting to come around to the same feeling.

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).

That sounds like a reasonable way to move forward.

I'm not a pcase expert. How would one go about doing the pcase stuff? That is, how does one provide a pattern so that code like (pcase time ((decoded-time :year y :month m) (some-expr-involving y & m))) can extract the year and month components Y and M from the broken-down time TIME that was created via (make-decoded-time :year y :month m)? Is there an example of doing this sort of thing somewhere?



reply via email to

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