Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: rebuilding lazy Moose attributes

by tobyink (Abbot)
on Aug 20, 2013 at 21:48 UTC ( #1050250=note: print w/ replies, xml ) Need Help??

in reply to rebuilding lazy Moose attributes

I tend to use 'ro' attributes as much as possible and thus avoid things like this.

I have a module Trait::Attribute::Derived that offers a bunch of sugar for deriving one attribute from another, but it doesn't offer this feature. Perhaps it should?

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Comment on Re: rebuilding lazy Moose attributes

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1050250]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2015-11-28 05:27 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (738 votes), past polls