On Fri, 25 Jul 2003 [EMAIL PROTECTED] wrote: > I'm trying to figure out how to allow for incomplete year/month/day, > year/week/day, or year/day in DT::I. > > One way is to have a separate implementation for each case: > > DateTime::Incomplete > > year / set_year > month / set_month > day / set_day > > DateTime::Incomplete::YearWeekDay > > week_year / set_week_year > week_number / set_week_number > day_of_week / set_day_of_week > > DateTime::Incomplete::YearDay > > year / set_year > day_of_year / set_day_of_year > > DateTime::Incomplete::Agnostic - base class > > to_datetime > next / previous / etc. > > Another approach: the API would remember what methods were called, and > adjust to that: if you called "set_week_number", then it is an error if > you call "set_month".
This is too clever. People will get errors depending on which method they call first, and will have a hard time figuring out why it fails. Personally, I'd like to just see a simple DT::Incomplete that looks as much like DateTime.pm as possible for now. If people clamor for other variations, they can be provided, but I just don't see a need to implement _everything_ at the moment. I know people like to work on hard, cool things, but I for one don't want to flood CPAN with a host of complex, weird special case datetime modules that don't serve a clear need. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/
