develooper Front page | perl.perl6.language | Postings from April 2010

expression of seconds (was Re: A new era for Temporal)

Thread Previous | Thread Next
From:
Darren Duncan
Date:
April 9, 2010 12:55
Subject:
expression of seconds (was Re: A new era for Temporal)
Message ID:
4BBF863D.2020706@darrenduncan.net
Dave Rolsky wrote:
> On a smaller point, I think second vs whole_second is the wrong Huffman 
> coding. I'd think most people want the integer value.

Well, whatever you call things, the most important thing is to keep the seconds 
count as a single number which can do fractions, or if you really must break 
them up, then have the fractional second part as a real in 0..^1.  The whole 
"nanosecond"-integer-fixed-onesizefitsall-subsecond-precision thing is a 
terrible hack.  Keeping a single number for seconds is best from a conceptual 
and a usability and a math point of view.  If users only want the integer value, 
then they can just store the second as an integer in the first place.  As for 
the name, well "whole_second" can be made shorter, or its value could 
automatically truncate if users assigned it to an Int.  Even Larry said that 
using reals for seconds if we're supporting fractional seconds is preferred in 
Synopsis 2, and I agree; if people think otherwise, then what is the rationale? 
-- Darren Duncan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About