John Siracusa schreef:
> On 7/16/03 1:40 PM, Ben Bennett wrote:
>
> What is the advantage of excluding things that are simple to parse, but not
> "conceptually simply"?
Not confusing the user who doesn't need it. If you want anything
complex, either to parse or to conceptualisate, then you're supposed to
be able to select the correct Format module to use.
> I'd actually argue that infinity is pretty "straightforward" anyway, and
> important enough to have its own DT classes already.
I don't want the default parser (if such a thing, godforbid, is
implemented) to be able to return DT::Inf!
Take the following example:
$dt = DateTime->parse( $user_input ) or die "invalid date $user_input";
print CONFIGFILE DateTime::Format::MyConfig->format_datetime($dt);
This should just work. Most of the formatting modules don't know what to
do with infinite dates. Similarly, most of the programs using DT won't
use infinite dates. It is a pain to check for infinity everywhere.
In a DT::F::NotSoSimple, that is not the default, there is no problem
with returning an infinite datetime. Those modules have to be selected
by the programmer anyway, so as long as it is documented that it can
return DT::Inf, the programmer gets what he asks for.
> I don't think infinity needs to be locale aware. "Inf" will not be locale
> aware in Perl 6, AFAIK, for example.
Perl 6 is for programmers. I thought you needed the DT::F::Simple module
for user input. If English users try to submit the string "infinite" in
a web form (I doubt it, but hypothetically...), Dutch users would
certainly type "oneindig".
Eugene