From: Michael Albinus <michael.albinus@gmx.de>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: master d0c77a1: Remove some assumptions about timestamp format
Date: Fri, 28 Sep 2018 12:26:54 +0200 [thread overview]
Message-ID: <87bm8hape9.fsf@gmx.de> (raw)
In-Reply-To: <83h8ia6sj6.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 28 Sep 2018 09:32:45 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> I'm afraid we need something better than that, as it mishandles NaNs.
>> Also, there's no need for a special "invalid_time" value; you can just
>> use a NaN.
>
> It's OK to support NaNs in time values, but I'm uneasy with the
> recommendation to use NaN as an invalid time. IMO, NaNs should only
> come out of calculations, never from initial literal values of a
> program (except when the program wants to test NaN handling).
Indeed. A NaN is not a time value all time functions do understand. For
example,
(current-time-string 0.0e+NaN)
=> (error "Specified time is not representable")
I believe, a special string shall be returned here, like
"Unspecified time" or so.
> What is the problem with having a special invalid time value?
Tramp will use such a constant anyway, it has taken '(0 0) until now. It
will be returned by Tramp implementations of functions like
`file-attributes' or `visited-file-modtime', and must be understood by
the calling functions. `set-file-times', for example, does not
understand this, and so do the functions in ls-lisp.el, and likely in
Lisp packages in the wild.
(write-region "foo" nil "/tmp/foo")
(set-file-times "/tmp/foo" 0.0e+NaN)
=> (error "Specified time is not representable")
`set-file-times' shall simply return nil in this case, as said in the
docstring.
Therefore it would be better to a have an agreed constant, which is
understood by both Tramp and its callers.
What's wrong with the result of invalid_timespec() of systime.h, as
proposed earlier?
Best regards, Michael.
next prev parent reply other threads:[~2018-09-28 10:26 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180925021527.10418.61555@vcs0.savannah.gnu.org>
[not found] ` <20180925021528.9A119204E8@vcs0.savannah.gnu.org>
2018-09-25 10:09 ` master d0c77a1: Remove some assumptions about timestamp format Michael Albinus
2018-09-26 1:09 ` Paul Eggert
2018-09-26 9:24 ` Michael Albinus
2018-09-26 9:39 ` Eli Zaretskii
2018-09-26 9:43 ` Michael Albinus
2018-09-27 20:46 ` Paul Eggert
2018-09-28 6:32 ` Eli Zaretskii
2018-09-28 10:26 ` Michael Albinus [this message]
2018-09-28 17:27 ` Paul Eggert
2018-09-29 13:35 ` Michael Albinus
2018-09-28 14:45 ` Paul Eggert
2018-09-28 14:54 ` Michael Albinus
2018-09-28 1:50 ` Paul Eggert
2018-09-28 10:35 ` Michael Albinus
2018-09-28 17:39 ` Paul Eggert
2018-09-28 18:06 ` Naming predicates (was: master d0c77a1: Remove some assumptions about timestamp format) Stefan Monnier
2018-09-28 18:28 ` Drew Adams
2018-09-28 19:12 ` Paul Eggert
2018-09-28 19:26 ` Naming predicates Stefan Monnier
2018-09-28 19:40 ` Drew Adams
2018-09-28 19:41 ` Naming predicates (was: master d0c77a1: Remove some assumptions about timestamp format) Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bm8hape9.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=eggert@cs.ucla.edu \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.