From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: encode-time vs decode-time Date: Wed, 07 Aug 2019 17:44:47 +0300 Message-ID: <83r25xavc0.fsf@gnu.org> References: <502b23f8-58ed-38ff-ae50-fae391129a10@cs.ucla.edu> <87v9viuivo.fsf@mouse.gnus.org> <83blx2cr2o.fsf@gnu.org> <8336iecfvr.fsf@gnu.org> <68d24d6a-d427-baef-27e9-ea1cbbd64c18@cs.ucla.edu> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="254851"; mail-complaints-to="usenet@blaine.gmane.org" Cc: larsi@gnus.org, andrewjmoreton@gmail.com, emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 07 16:45:30 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 1hvNBu-00147e-F0 for ged-emacs-devel@m.gmane.org; Wed, 07 Aug 2019 16:45:26 +0200 Original-Received: from localhost ([::1]:41994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvNBt-0002i0-CR for ged-emacs-devel@m.gmane.org; Wed, 07 Aug 2019 10:45:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43679) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvNBT-0002cf-G8 for emacs-devel@gnu.org; Wed, 07 Aug 2019 10:45:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hvNBS-0003y9-II; Wed, 07 Aug 2019 10:44:58 -0400 Original-Received: from [176.228.60.248] (port=2531 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hvNBS-0003pB-2d; Wed, 07 Aug 2019 10:44:58 -0400 In-reply-to: <68d24d6a-d427-baef-27e9-ea1cbbd64c18@cs.ucla.edu> (message from Paul Eggert on Tue, 6 Aug 2019 18:02:30 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:239223 Archived-At: > Cc: larsi@gnus.org, andrewjmoreton@gmail.com, emacs-devel@gnu.org > From: Paul Eggert > Date: Tue, 6 Aug 2019 18:02:30 -0700 > > Although almost all uses of decode-time will be unaffected by the change, > there's little doubt that some user code somewhere will break because it > (mistakenly) assumes that decode-time's result format will never be extended. If > this is a real concern, we can go about the change in some other way. > > One alternative would be to leave decode-time's API unchanged from Emacs 26 and > put the new functionality into a new function, say "time-calendrical". While > we're at it, we could call the data structure that the new function returns a > "calendrical timestamp" instead of a "decoded timestamp", and rename the > recently-added functions make-decoded-time, decoded-time-hour, decoded-time-year > etc. to make-calendrical-time, calendrical-hour, calendrical-year, etc. This > would reduce confusion, as it is harder to remember what a "decoded time" is > than to remember what a "calendrical time" is, at least for me. Also, we could > document that the calendrical data structure may change in future versions, and > that programs should use the new functions rather than inspect the raw data > structure. Another alternative is to make the SECONDS member be a float, then we could return the extra precision there. Would this be a better way to keep backward compatibility?