On Thu, Sep 30, 2010 at 02:35:13PM -0400, Hans Dieter Pearcey wrote:
> We don't like the fact that lazy_build autogenerates public clear_$attr and
> has_$attr methods for you....
> 1) reuse 'builder', i.e. 'builder => 1' is special cased to be the same as
> 'builder => "_build_$attr"'
> 
> Someone said "what about subs named '1'?" but I think we're probably all OK
> with ignoring anyone crazy enough to do that.

That was me, but I want to make clear that even I am not so crazy to do
that :)

> 3) make the clearers and predicates generated by lazy_build issue deprecation
> warnings the first time they're called that suggest specifying a clearer 
> and/or
> predicate, and ship a Moose::Deprecated::LazyBuildPublicMethods (or whatever)
> to shut them up.

I like option #3 best, but doing #1 as well might be quite useful too --
I can forsee an outcry "what, you mean I need to type out my builder method
names?

> Upside: people who aren't affected don't have to care, people who are affected
> have a simple solution ("just add 'use Moose::Deprecated::blahblah' to your
> class").  Also, we never have to actually remove the clearers/predicates and
> risk breaking people's code if we don't want to.

deprecations++.

Thanks for writing this up, Hans!

-- 
                    A: To be or not to be.
                    Q: What is the square-root of four b-squared?
            .             .            .            .             .
Karen Etheridge, ka...@etheridge.ca       GCS C+++$ USL+++$ P+++$ w--- M++
http://etheridge.ca/                      PS++ PE-- b++ DI++++ e++ h(-)

Reply via email to