On Thu, 20 Mar 2003 [EMAIL PROTECTED] wrote: > Dave Rolsky wrote: > > > $set1 = DateTime::SpanSet->new( start_set > => $dt_set, end_set => $dt_set ); > > What would this create exactly? > > This is the same thing, but with another syntax (I prefer this one): > > $set_start = new DateTime::Set( $day1, $day3 ); > $set_end = new DateTime::Set( $day2, $day4 ); > $spanset = $set_start->until( $set_end ); > > It creates this DateTime::SpanSet: > [ $day1 .. $day2 ) , [ $day3 .. $day4 ) > meaning: > a time-span that > starts in day1 and ends before day2, then > restarts in day3 and ends before day4. > > - set_start and set_end can be recurrences.
Woah, this is asking for trouble. What if one set has 3 elements and the other 2? Or what if one is infinite and one isn't? There might be some logical way to handle this but I think it'll get way too confusing for most users way too fast, leading to bugs. I think the API needs to be simple and encourage simplicity in its use, because this is a complicated area. It's much simpler to simply have people make a bunch of DateTime::Span objects and have them pass it in. Alternately, we might accept a list of pairs of objects. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/