> A "infinite recurrence" is stored as a reference > to a subroutine (there are actually 3 closures > in each recurrence). This is managed by the > Set::Infinite::_recurrence module. > > You can see the internal data structure by running > this: > --- > use DateTime::Event::Recurrence; > use DateTime::SpanSet; > use Data::Dumper; > use strict; > > my $dt_set1 = DateTime::Event::Recurrence->daily; > my $dt_set2 = $dt_set1->clone->add( hours => 12 ); > > my $spanset = DateTime::SpanSet->from_sets > ( start_set => $dt_set1, > end_set => $dt_set2 ); > > print "DateTime::Set\n\n"; > print Dumper ( $dt_set1 ); > > print "\n\nDateTime::SpanSet\n\n"; > print Dumper( $spanset ); > --- > > The "recurrence" is the part that says: > > 'param' => [ > sub { ... > sub { ... > sub { ... > ], > > See also: > http://search.cpan.org/~fglock/Set-Infinite- > 0.55/lib/Set/Infinite.pm#INTERNALS
Flavio, thanks a lot for the information. I had already looked into the internal structure using the Data::Dumper package, but couldn't really understand how it works. And to be honest, I still can't understand what's going on. Most of the 'param' key subs have "DUMMY" in it which can't really mean anything. > > So my question really is: is a recurrence set that is used to > > create a SpanSet preserved in that SpanSet? If so, can I > > extract it? > > I don't think it is advisable to do that. > Note that the data structure becomes much more > complex as you start doing operations like > union/intersection/complement/... If it's not advisable, is it feasible? I mean, is there a way to get the original set information from a spanset. If so, I guess, it would even make the new structure less complex. I'd really like to support unbounded sets as my design wouldn't work without and I'd have to 'pollute' my code with ugly workarounds. So if you could give me some advice, I'd be really grateful.