Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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.

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2021-10-26 19:31 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (90 votes). Check out past polls.