From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: master d0c77a1: Remove some assumptions about timestamp format Date: Fri, 28 Sep 2018 10:39:38 -0700 Organization: UCLA Computer Science Department Message-ID: <3356af4b-f6f5-e353-6162-a5fa8880d223@cs.ucla.edu> References: <20180925021527.10418.61555@vcs0.savannah.gnu.org> <20180925021528.9A119204E8@vcs0.savannah.gnu.org> <87bm8lanwu.fsf@gmx.de> <87o9ck6270.fsf@gmx.de> <2cfc5ca3-d661-f431-397a-705682ab17eb@cs.ucla.edu> <877ej5ap0o.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------F45246253E9ECE4813F31630" X-Trace: blaine.gmane.org 1538156409 5400 195.159.176.226 (28 Sep 2018 17:40:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 28 Sep 2018 17:40:09 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 Cc: emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 28 19:40:04 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g5wkF-0001Ig-FH for ged-emacs-devel@m.gmane.org; Fri, 28 Sep 2018 19:40:03 +0200 Original-Received: from localhost ([::1]:44566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5wmM-0000Om-0r for ged-emacs-devel@m.gmane.org; Fri, 28 Sep 2018 13:42:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5wlZ-0000Nd-6A for emacs-devel@gnu.org; Fri, 28 Sep 2018 13:41:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5wkj-0007Bs-EW for emacs-devel@gnu.org; Fri, 28 Sep 2018 13:40:41 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:53930) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g5wki-0006Ui-TM for emacs-devel@gnu.org; Fri, 28 Sep 2018 13:40:33 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4C514160EF0; Fri, 28 Sep 2018 10:39:40 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id BeZTbEz7XTl5; Fri, 28 Sep 2018 10:39:39 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id F3664160FB4; Fri, 28 Sep 2018 10:39:38 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id AIK92bfB8aZf; Fri, 28 Sep 2018 10:39:38 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id CC9FA160EF0; Fri, 28 Sep 2018 10:39:38 -0700 (PDT) In-Reply-To: <877ej5ap0o.fsf@gmx.de> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:230108 Archived-At: This is a multi-part message in MIME format. --------------F45246253E9ECE4813F31630 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Michael Albinus wrote: > Shouldn't this be `time-equal-p', as we have already `time-less-p'? Thanks, as a Scheme refugee I never can remember which predicates should end in "-p" vs "p" vs nothing. I installed the attached. > Tramp (and other functions) must check, whether a given time value > is the "don't know" value. Therefore, > > (time-equal time-value 0.0e+NaN) > > must return t, if time-value is a NaN. And what if either value is a > float infinity? It appears that NaN isn't what Tramp wants. As a time value, NaN should work like floating-point NaN does; it should never compare numerically equal to anything, not even to itself (anything else would lead to even more confusion than what we already have :-). I hope that my other suggestion for Tramp suffices, so that we don't need to worry about what happens with NaNs in comparisons. --------------F45246253E9ECE4813F31630 Content-Type: text/x-patch; name="0001-Rename-time-equal-to-time-equal-p.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Rename-time-equal-to-time-equal-p.patch" >From 857c2c271080ef62e57128f531cee6e974ca28fb Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 28 Sep 2018 10:32:41 -0700 Subject: [PATCH] Rename time-equal to time-equal-p This is for consistency with time-less-p. * doc/lispref/os.texi (Time Calculations), etc/NEWS: * src/editfns.c (Ftime_equal_p, syms_of_editfns): * test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time): Rename. --- doc/lispref/os.texi | 2 +- etc/NEWS | 2 +- src/editfns.c | 4 ++-- test/lisp/emacs-lisp/timer-tests.el | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 400e6bb45c..8ce5a5ed6d 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1739,7 +1739,7 @@ Time Calculations The result is @code{nil} if either argument is a NaN. @end defun -@defun time-equal t1 t2 +@defun time-equal-p t1 t2 This returns @code{t} if @var{t1} and @var{t2} are equal time values. The result is @code{nil} if either argument is a NaN. @end defun diff --git a/etc/NEWS b/etc/NEWS index 4dd4260b29..e6508eb60b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -957,7 +957,7 @@ infinities and NaNs too, and propagate them or return nil like floating-point operators do. +++ -** New function 'time-equal' compares time values for equality. +** New function 'time-equal-p' compares time values for equality. ** define-minor-mode automatically documents the meaning of ARG. diff --git a/src/editfns.c b/src/editfns.c index acd80bbf31..daea746387 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1676,7 +1676,7 @@ See `current-time-string' for the various forms of a time value. */) return time_cmp (t1, t2) < 0 ? Qt : Qnil; } -DEFUN ("time-equal", Ftime_equal, Stime_equal, 2, 2, 0, +DEFUN ("time-equal-p", Ftime_equal_p, Stime_equal_p, 2, 2, 0, doc: /* Return non-nil if T1 and T2 are equal time values. */) (Lisp_Object t1, Lisp_Object t2) { @@ -5765,7 +5765,7 @@ it to be non-nil. */); defsubr (&Scurrent_time); defsubr (&Stime_add); defsubr (&Stime_subtract); - defsubr (&Stime_equal); + defsubr (&Stime_equal_p); defsubr (&Stime_less_p); defsubr (&Sget_internal_run_time); defsubr (&Sformat_time_string); diff --git a/test/lisp/emacs-lisp/timer-tests.el b/test/lisp/emacs-lisp/timer-tests.el index 0e40cdf442..c5971ee768 100644 --- a/test/lisp/emacs-lisp/timer-tests.el +++ b/test/lisp/emacs-lisp/timer-tests.el @@ -40,7 +40,7 @@ (should (debug-timer-check)) t)) (ert-deftest timer-test-multiple-of-time () - (should (time-equal + (should (time-equal-p (timer-next-integral-multiple-of-time '(0 0 0 1) (1+ (ash 1 53))) (list (ash 1 (- 53 16)) 1)))) -- 2.17.1 --------------F45246253E9ECE4813F31630--