On 03/10/2010 04:50 AM, Jesse Luehrs wrote:
On Tue, Mar 09, 2010 at 02:48:14PM -0500, Sir Robert Burbridge wrote:
On 3/7/10 9:52 PM, Tomas Doran wrote:
On 5 Mar 2010, at 16:29, Jesse Luehrs wrote:
Yes, those are for Moose attributes (has foo =>  (...)). To introspect
methods, you want get_all_methods, and if you want to be able to see sub
attributes with this, you want MooseX::MethodAttributes.

But before you do this I caution you to think twice.

attributes in perl are horrible to use and parse. MX::MethodAttributes
just shoves the information into the metaclass, and makes no attempt
to solve this problem.

What are you trying to do that requires attributes, and why wouldn't
it be clearer (and probably more flexible) to provide some declarative
sugar yourself instead?

Cheers
t0m
Actually, I'm just trying to learn.  I was looking at Catalyst and
wanted to see if I could emulate its dispatcher (as an educational
exercise) before looking at the actual code.

I've never used method attributes in practice, but I wanted to
understand them better so I can be up-to-date with the state of the Perl
art =)
Tomas's point was that method attributes are not the state of the Perl
art(: They're an annoying and ugly hack that Catalyst keeps around
pretty much just because changing how all of that works now would be a
pretty huge pain (considering back compat and such).

-doy
You know, it occurred to me after I sent my last reply that, while I want to understand how attributes work (so I can choose for or against them informedly), I don't know any arguments against them. The arguments for them are fairly obvious. What's bad about them? What makes them "annoying and ugly?" While I'm evaluating them, I don't want to miss out on considerations of people more experienced with them than myself.

Can you point me to a critique or two that I can look at? I didn't find any real negative critiques when I searched on google just now.

Thanks -- I appreciate it!


-Sir

Reply via email to