Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Moose roles

by dk (Chaplain)
on Jan 13, 2010 at 18:31 UTC ( [id://817253]=note: print w/replies, xml ) Need Help??


in reply to Re: Moose roles
in thread Moose roles

Yes, my apologies, I didn't reference this post in the list.

Off the topic,.I don't understand why "has" doesn't allow shorter syntax - if I write "has x => (is=>rw, isa=>Int, ....)" two thousand times, why can't I declare a subtype or trait or whatever that would be accessible with "has x => mytype"? That's just not perlish, to write too much when you can avoid that :)

Replies are listed 'Best First'.
Re^3: Moose roles
by EvanCarroll (Chaplain) on Jan 13, 2010 at 22:03 UTC
    Because has just says you want an attribute; rw means to generate getters/setter methods isa => x ({x != Any}) means you want it strictly typed (as much as you can get anyway)


    Evan Carroll
    The most respected person in the whole perl community.
    www.evancarroll.com

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-04-18 07:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found