On Tue, Sep 09, 2008 at 16:06:48 -0400, Sartak wrote:

> * Sub::Exporter is used for a more powerful export. I use its extra
> features (as a user of a Sub::Exporter module) very infrequently, so
> being able to drop down to regular Exporter would be useful.

I think for the case of renaming exports, currying etc Mouse is
probably not going to be used anyway. If you're making compromises
WRT metaprogramming you can probably afford to compromise on
convenience too.

This is by far the biggest dependency when you factor in its deps,
and with the least benefits compared to the other deps. As much as I
love S'Ex there's a time and place for everything.

> * Scalar::Util is used for blessed, weaken, looks_like_number, and
> openhandle. It's in core as of 5.8, but if we need 5.6 then I think we
> can make it work:
> 
> - looks_like_number and openhandle are used only for the Num and
> FileHandle type constraints. These aren't used very often as far as I
> know, so perhaps we can delay-require Scalar::Util.
> 
> - weaken is only used whenever you want weak refs for an attribute. I
> personally do this with some frequency. But if you don't use it
> 
> - blessed is used a lot. "use Mouse" also exports it. We could
> probably provide an alternate implementation that uses ref and makes
> sure it isn't a builtin type.

Scalar::Util has that, when built without XS. The only feature it'll
be missing is weaken(), but that requires core support anyway. It
errors out gracefully (FSVO) and Mouse/Moose code depending on
weak refs should really dep on Task::Weak anyway.

I think Scalar::Util is a reasonable dependency.

BTW, According to CPAN testers ClassName TC checking is also broken
on 5.6

> * MRO::Compat is used for get_linear_isa. We could implement this in
> Perl (and using mro::get_linear_isa if $] >= 5.10).

This is probably the biggest dep, but actually it's very trivial to
overcome: if somebody wants C3 inheritence they have to dep on it
themselves. MRO::Compat's dfs linear_isa can be copypasted

> * Class::Method::Modifiers are used for before/after/around. I wrote
> this one, so we have more flexibility here. It's only a few pages of
> code, so we could just add it into Mouse::OneFile, or again delay-load
> it.

I think delay loading is probably the way to go here, but keeping
the dep in Mouse's own Makefile.PL.

That way TB2 can bundle Mouse without this dep safely, but normal
code is unaffected.

-- 
  Yuval Kogman <[EMAIL PROTECTED]>
http://nothingmuch.woobling.org  0xEBD27418

Reply via email to