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

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

by Arunbear (Prior)
on Jan 23, 2015 at 18:31 UTC ( #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
Node Status?
node history
Node Type: note [id://1114315]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2020-10-28 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (261 votes). Check out past polls.

    Notices?