Moose::Manual!

autarch on 2009-02-03T19:35:43

I'm very excited to announce the first release of the new Moose::Manual documentation as part of the Moose 0.66 release. This is part of the documentation work being funded by the Moose docs grant from TPF.

One of the complaints we often hear about Moose is that the docs are not good enough, and that it's hard to get started with it. The Manual was created to address this issue. I'm hoping that it will be a good starting point for people to understand Moose concepts and features. After reading it, you should be able to start creating Moose-based classes right away.

I also hope that people will give us feedback on the Manual. It's still new, and I'm sure there are parts that need polish, and concepts which were left out. If there's something you're confused about or wish were documented, please email me or visit the Moose IRC channel and tell us.

Cross-posted by hand from House Absolute(ly Pointless) - permalink.


Computed attributes

zby on 2009-02-04T10:15:11

One thing that I have trouble conceptualize is how to deal with attributes that are computed from other attributes ( for efficiency reasons ). I think it would help newcomers if an overview of how to deal with that was added to Moose::Manual::Construction. It's only recently that I discovered lazy_build - it seems like it is *the solution* to this problem - is that right? Are there any hidden disadvantages?

Re:Computed attributes

Stevan on 2009-02-05T16:18:07

'lazy_build' is nice, but any combination of 'lazy' with 'default' or 'builder' will work for this too. The first argument to 'default' and 'builder' is always the object instance, and if the attribute is also marked as 'lazy' then you are pretty much assured that the instance will be fully initialized as well (unless you have weird circular dependencies, but those are not terribly common).

- Stevan