Darren Duncan wrote:
> 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.
my Int $x implies a constraint, *not* a coercion. That's:
$dt.seconds.Int
Though even clearer and same number of characters as whole_seconds is:
$dt.seconds.round
Jonathan
Thread Previous
|
Thread Next