On Sat, 21 Jun 2003, Joshua Hoblitt wrote:

> > > DT::TZ::LINKS is still the only internal structure that is modified.
> >
> > Yes, but you access @DT::TZ::ALL as well.
>
> I was necessary to verify that what an alias was pointing to was valid.
> Once the dependency was already there I implemented the rest.

But this should be done by asking DateTime::TimeZone.

> > Yes, we should.  I don't object to some sort of "is_olson_timezone" method
> > for DT::TZ.
>
> Well it really ALL should be part of TimeZoneCatalog but that name isn't
> any better then Alias.

DateTime::TimeZone loads the TimeZoneCatalog.pm file, but all the stuff in
that file is in the DateTime::TimeZone namespace.  It's just that the
latter is a generated file, so I wanted to make it separate.

Users would just do something like:

 if ( DateTime::TimeZone::is_olson_timezone('foo/bar') ) { ... }

which to me makes more sense than asking the alias module if it is an
actual timezone.

Also, I'm not entirely against the idea of folding all the alias stuff
into the main DT::TZ module.  It doesn't seem like an entirely wack idea,
though I'd be glad to hear why I'm wrong ;)

> > Send me a patch, don't just implement a totally redundant method in
> > another module.  That's silly.
>
> Alias was intended as a "user" interface.  Whats in TZCatalog looks to
> me like it's intended for use in the internals.

No, it's just a generated file.  That's all.  The functions at the bottom,
like all_names(), are documented in the DateTime::TimeZone docs.

> > > > All of the stuff about dying if an alias is defined and so on seems
> > > > like total overkill.  The purpose of this module, AFAIC, is for
> > > > individual end-users to be able to define some useful _local_ aliases,
> > > > in an
>
> I'd like to add to my original comments that this is for the same
> reasons you want DT to be picky about inputs.

I guess it's not that big a deal, as long as it's documented.

> > Sure, we can give them enough rope, but I don't want to include code aimed
> > at dubious uses.  This is the same reason I want DateTime constructors to
> > always validate input.
>
> Can you give me an example of a dangerous use?

Distributing a module that uses DT::TZ::Alias and sets an alias, unless of
course, that module is something like DT::TZ::Alias::Australian or
something like that.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to