emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Support for sub-second time in decoded time


From: Lars Ingebrigtsen
Subject: Re: Support for sub-second time in decoded time
Date: Mon, 29 Jul 2019 16:59:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Lars Ingebrigtsen <address@hidden>
>> Date: Mon, 29 Jul 2019 11:48:02 +0200
>> 
>> `current-time' returns its data as (HIGH LOW USEC PSEC), but now that we
>> have bignum support, perhaps we don't need to do it this way.  What
>> about just having a field in decoded times that's the fraction of a
>> second?
>
> That'd be backward-incompatible, no?

It's an extra field in the structure returned from `decode-time'.  There
may be callers that rely on it being exactly 8 elements...  But I don't
think that's very likely?  Hm...  I guess I could see people saying
stuff like

(destructuring-bind (....) (decode-time)
  )

and that would break, but on the other hand, you don't see many people
using those constructs in Emacs Lisp code.

We could add an optional parameter to `decode-time'
INCLUDE-FRACTIONAL-SECONDS and only include the 9th element then.  But I
think we'd then basically would want to change all callers in Emacs to
include that parameter.

That's a safer option, though.

Either is fine with me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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