develooper Front page | perl.perl6.language | Postings from February 2009

Re: Temporal and purity (was: Re: IO, Trees, and Time/Date)

Thread Previous | Thread Next
From:
Mark J. Reed
Date:
February 20, 2009 09:19
Subject:
Re: Temporal and purity (was: Re: IO, Trees, and Time/Date)
Message ID:
f60fe000902200919p2b92ca37oc945d174a66dc9de@mail.gmail.com
Dates starting at midnight is fine, but I agree that a Date shouldn't
automatically coerce into midnight on that date.  If it's going to
autocoerce at all, I'd recommend noon instead, but better to force the
programmer to pick what they mean.

On Fri, Feb 20, 2009 at 2:32 AM, David Green <david.green@telus.net> wrote:
> On 2009-Feb-19, at 4:39 pm, Martin Kealey wrote:
>>
>> 2. "Date isa Instant" works sensibly: anywhere that expects an Instant,
>> you
>> can give it a Date. (Assuming we all agree that dates start at midnight,
>> but
>> then we *are* talking specifically Gregorian dates.)
>
> I don't like dates just starting at midnight because I've run into too many
> awkward cases where $time < $date doesn't do what you mean because it
> assumes 0:00:00 when you meant 23:59:59.  I'd rather have dates becomes
> time-ranges.
>
> Or perhaps don't make them coercible and require an explicit conversion via
> $date.morning or $date.evening or something.   (Maybe require $time ∩ $date
> or $time ⊂ $date?)
>
>
> -David
>
>



-- 
Mark J. Reed <markjreed@gmail.com>

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