Hi All.
DateTime::Set was changed fairly recently in such a way as to
necessitate special handling of infinite datetimes in recurrences. This
isn't such a bad thing, but it does introduce complexity into even the
simplest of recurrences.
From the DateTime::Set docs:
# a 'monthly' recurrence:
Matt Sisk wrote:
If a developer really had a need for handling infinite values, then this
wrapping could be explicitely disabled with a parameter in the constructor.
This was dismissed in a discussion here.
(the parameter detect_bounded is commented out in the code)
- Flavio S. Glock
On Thu, 24 Jun 2004, Flavio S. Glock wrote:
Matt Sisk wrote:
If a developer really had a need for handling infinite values, then this
wrapping could be explicitely disabled with a parameter in the constructor.
This was dismissed in a discussion here.
Really, did I dismiss it? I can't
Dave Rolsky wrote:
On Thu, 24 Jun 2004, Flavio S. Glock wrote:
Matt Sisk wrote:
If a developer really had a need for handling infinite values, then this
wrapping could be explicitely disabled with a parameter in the constructor.
This was dismissed in a discussion here.
We actually would be changing the current capability, if not the current
behavior. Having 'detect_bounded' enabled by default would implement
what I discuss but not break anything that already detects bounds on its
own.
Whether that's the right name or not...it seems okay to me, but other
On Thu, 24 Jun 2004, Matt Sisk wrote:
We actually would be changing the current capability, if not the current
behavior. Having 'detect_bounded' enabled by default would implement
what I discuss but not break anything that already detects bounds on its
own.
Whether that's the right name or
This works fine, actually:
use DateTime::Set;
print $DateTime::Set::VERSION, \n;
$months = DateTime::Set-from_recurrence(
recurrence = sub {
return $_[0]-truncate(
to = 'month' )-add( months = 1 )
},
);
print $months-next( DateTime-now
[EMAIL PROTECTED] wrote:
If your recurrence specification is well-behaved,
(don't use internals, etc) you don't have to test
for infinite-ness.
You only have to use
return $_[0] if $_[0]-is_infinite;
if your code can't handle DateTime::Infinite.
As is wont with discussions of infinity, how to
On Thu, 24 Jun 2004, Matt Sisk wrote:
Unless I'm missing something, it boils down to efficiency (why
pointlessly run a DT::Infinite object through its paces) vs edge cases
(probably some case of comparing a DT::Infinite to another DT::Infinite
and thereby getting caught in an infinite loop).