Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1050250]
help
Chatterbox?
[Eily]: same as many/much, few/little
[Discipulus]: so my 'less' usage sounded not so correct? 'fewer' was more appropriate? i take a note too
Discipulus $ENV{PAGER}='fewer '
[Corion]: Discipulus: Hahahaa! ;)
[Corion]: This would be a great April fools joke, since it certainly makes sense to show fewer pages on screen :)
[marioroy]: greetings all
[Corion]: Hi marioroy!

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2018-01-23 09:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (242 votes). Check out past polls.

    Notices?