in reply to Re^3: Moose is lovely
in thread Moose is lovely

Does it play well with lazy?

Replies are listed 'Best First'.
Re^5: Moose is lovely
by stvn (Monsignor) on Feb 29, 2008 at 20:02 UTC
    Does it play well with lazy?

    Yes, in fact the motivation for putting it in Class::MOP was to support the 'lazy_build' option in Moose (which is sort of documented in Moose::Meta::Attribute under "is_lazy_build", more docs to come, patches welcome and all that).

    In general if an option does not play well with another option, we consider it a "syntax" error and throw an exception at compile time.

    -stvn
Re^5: Moose is lovely
by nothingmuch (Priest) on Feb 29, 2008 at 20:09 UTC
    Wonderfully. There's even a shortcut for that: lazy_build => 1. It works like this:
    has foo => ( ... lazy_build => 1, ); sub _build_foo { my $self = shift; ... }
    -nuffin
    zz zZ Z Z #!perl