On 7/16/03 1:40 PM, Ben Bennett wrote: > Well, I don't think that the simple is supposed to indicate simple to > parse (at the moment the parser is all but simple... but I am trying > to clean it up). I read it as "simple formats", i.e. common formats > that define the date and time in fairly straightforward ways (month names > and numbers for things are fine, "next week" "third thursday in the > next month with a blue moon" are not).
What is the advantage of excluding things that are simple to parse, but not "conceptually simply"? I'd actually argue that infinity is pretty "straightforward" anyway, and important enough to have its own DT classes already. The default "simple" parser should be able to return infinite dates under some "simple" circumstances. Parsing "+/-infinity" is such a circumstance, IMO. > The other problem I see is that your regexp only covers English > speaking locales... I am currently using the DateTime::Locale date to > get locale sensitive information for parsing month and day names. > (Although AM/PM and BC/AD are a bit of a problem, I may need to add > extra information somewhere). I don't think infinity needs to be locale aware. "Inf" will not be locale aware in Perl 6, AFAIK, for example. "+/-infinity" should be parsed as a constant representing the mathematical construct, not as an attempt to catch user input like "forever and ever." -John
