Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^9: Moose: What about "class" attributes?

by stvn (Monsignor)
on May 03, 2011 at 18:54 UTC ( #902760=note: print w/ replies, xml ) Need Help??


in reply to Re^8: Moose: What about "class" attributes?
in thread Moose: What about "class" attributes?

So the design of Param Role goes through all the trouble of making the params full-blown Moose Attributes rather than just arguments, and a parameter object rather than a hashref, but then you are careful not to close over either of them but only on plain values extracted from them.

No, those are parameters, they just look like Moose attributes, but underneath they are different.

Ref-counting leaks would be some kind of circular reference that the system is not tracking correctly. Or for whatever reason, the past existence of such leaks is why you are leery of closing over the complicated linked-up Moose objects involving anonymous classes.

Yes, Perl is pretty good at doing this, but sometimes if you have values passed around a lot inside objects, you can get a reference you didn't intend to keep. And closures tend to be a big source of these since people don't often notice all that it is they are closing over.

-stvn


Comment on Re^9: Moose: What about "class" attributes?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2014-12-25 03:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls