Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by stvn (Monsignor)
on May 03, 2011 at 18:54 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found