On Mon, 2003-08-18 at 02:37, [EMAIL PROTECTED] wrote:
> > Flavio, is there already a method to determine
> > the number of elements in a DateTime::Set? 
> > 
> > If not, I can currently make it as_list, and then
> > get the length of the list, but it would be 
> > cleaner to have a method to do this.
> 
> What would be a name for this method?

$set->length (sound like it could be a DT::Duration between the first
and last)

$set->elements (sounds like a clone of as_list)

$set->count (possible, though could it be a count of something else?)

$set->number_of_elements (long, but self explainitory)

So what does it return? I figure it returns
   1 + $#{$set->{set}{list}}
when it can, and it returns 
   $DateTime::INF
when it can't.

It would also be good if it could accept a span like as_list does.
Then if there is an infinite set (Say a set of Friday 13ths), we can get
the number of them in a particular span. Without the span parameter it
returns the count of the whole set or it returns INF.

Cheers!
Rick


Reply via email to