Hi,

Dave Whipp wrote:
> Larry Wall wrote:
>> The time function always returns the time in floating point.
> 
> I don't understand why time() should return a numeric value at all.
> Surely it should return a DateTime (or Time) object. Using epochs in a
> high level language seems like a really bad thing to be doing. If I
> want "duration since epoch" then I should subtract the epoch from the
> time -- resulting in a duration (which may indeed be a floating point
> value).

FWIW, I agree, but I'd like to propose standard overloadings:
  my $time = time;    # some kind of Date/Time object
  say ~$time;         # "Di 05 Jul 2005 20:01:42 CEST"
  say +$time;         # seconds since the Perl 6 epoch
                      # (2000-01-01 according to [1])

> For the sleep function, it seems reasonable to accept either a
> DateTime or a Duration,

or a number of seconds,

> which would sleep either until the requested time, or for the
> requested duration.


--Ingo

[1]
http://groups.google.de/group/perl.perl6.internals/msg/a572113dc089481b

-- 
Linux, the choice of a GNU | Elliptic paraboloids for sale.  
generation on a dual AMD   | 
Athlon!                    | 

Reply via email to