develooper Front page | perl.perl6.users | Postings from May 2018

Range of Dates

Thread Next
Sean McAfee
May 1, 2018 20:04
Range of Dates
Message ID:
Today I wanted to write an infinite sequence of Dates starting from today,
but I accidentally wrote two dots instead of three as I'd intended.  I was
surprised to find that it seems to work as one might expect, eg:

    ( .. *)[7] # one week from today

The online docs say that Ranges are only for numbers and strings, so how is
it that this works?  Is it an accident, or can anything that has a "succ"
method be in a Range, or...?

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About