On 7/16/03 11:21 AM, Ben Bennett wrote: > On Wed, Jul 16, 2003 at 10:15:46AM -0400, John Siracusa wrote: > [snip] >> IMO. Also, I don't think DT::Infinite is in the same boat, because >> that is a legitimate date (that DT::F::Simple must parse, BTW: >> /^([-+])?inf(?:inity)?$/i). Returning DT::Infinite is not an error! > > Is infinity really a simple date? I think no. Anyone else want to > weigh in?
Either way, I'll weigh in again! :) Of course it's "simple" because, in the context of DT::F::Simple, "simple" means "simple to parse." And this is pretty darned simple, IMO: if(/^([-+])?inf(?:inity)?$/i) { if($1 eq '-') { return DateTime::Infinite::Past->new; } return DateTime::Infinite::Future->new; } -John