Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^5: Making 'all' the attributes read only by default (Moo) (interface)

by Arunbear (Prior)
on Jan 23, 2015 at 18:31 UTC ( [id://1114315]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Making 'all' the attributes read only by default (Moo) (interface)
in thread Making 'all' the attributes read only by default (Moo)

My question came from looking at the code shown, where the interface given only contained some 'get' methods. There weren't even any (data) references that could be indirectly mutated via that interface.

Moose's obsession with attributes seems to be a result of it trying to emulate CLOS. Classes in CLOS are essentially structs that just contain data. The behaviours are defined in multimethods that live outside of classes. Moose doesn't provide the generic function / multimethod part of CLOS, so we're just left with trying to blend the Class-is-a-struct idea into Perl (which I agree is quite a suboptimal blend :)

  • Comment on Re^5: Making 'all' the attributes read only by default (Moo) (interface)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-18 05:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found