In Rant Mode: Part II

jk2addict on 2007-05-16T15:30:21

So during the usual discussions on #catalyst last night, we came to the following paraphrased topic:

other: mango using Moose?
me: no, but I do have a meta()
other: oh god. don't do that. please.
me: why? my modules, not using moose, meta is fair game. it's just a method.
other: the sky is falling. kittens will die of you do that.


Now, I understand the sentiment. Moose is the hot new thing. And it puts its object meta information in meta(). But hey, that's where I put my object meta information too. So does RDBO. So do other modules. Just telling people to never use a method called meta() is silly in some respects.

If the two need to merge in the future, I surmise that:

use metaclass 'MySpecialMetaClass';


is my friend.


Moose tries to play well

Stevan on 2007-05-16T20:39:55

I agree, no module has specific domain over &meta, I am not sure why "other" got so upset.

I dont know about the other &meta out there, but with Moose we try to always make sure we don't step on other modules toes. And in many cases we avoid calling ->meta and instead fetch the metaclass from the Class::MOP cache in a more direct fashion.

In fact, Class::MOP (the metaclass system Moose is built on) never insists on &meta and always fetches the metaclass from the cache.

- Stevan

use metaclass is not your friend

Stevan on 2007-05-16T20:44:02

If the two need to merge in the future, I surmise that:

use metaclass 'MySpecialMetaClass';
is my friend.

This will not work as you think, metaclass.pm installs it as &meta too (just like Moose). But we can talk more about the best solution when you get there :)

- Stevan

Me too

Alias on 2007-05-17T01:54:40

I always used ->Info in my codegen system's metadata stuff (I was using a rule where any capitalized methods would guarantee to work and never return undef or throw an exception.

But as I look at moving parts of it to CPAN, I most likely would be using ->meta as well.