From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Re: encode-time vs decode-time Date: Tue, 30 Jul 2019 12:34:54 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="188837"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (windows-nt) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 30 13:35:14 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hsQPR-000n0F-3a for ged-emacs-devel@m.gmane.org; Tue, 30 Jul 2019 13:35:13 +0200 Original-Received: from localhost ([::1]:59916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsQPQ-00060G-6C for ged-emacs-devel@m.gmane.org; Tue, 30 Jul 2019 07:35:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54053) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsQPK-0005zf-4K for emacs-devel@gnu.org; Tue, 30 Jul 2019 07:35:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsQPJ-0003vh-58 for emacs-devel@gnu.org; Tue, 30 Jul 2019 07:35:06 -0400 Original-Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226]:44906 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hsQPI-0003vE-Uc for emacs-devel@gnu.org; Tue, 30 Jul 2019 07:35:05 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hsQPH-000mpq-1r for emacs-devel@gnu.org; Tue, 30 Jul 2019 13:35:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:vxaeixRv5FIw5E+Y8QgU8ygGWPA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:239025 Archived-At: On Tue 30 Jul 2019, Lars Ingebrigtsen wrote: > Stefan Monnier 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". It seems that the naming of these functions is unhelpful. They should clearly distinguish between timestamps (absolute time/date) and durations (relative intervals) and be named as such. AndyM