in reply to Re^5: Runtime introspection: What good is it?
in thread Runtime introspection: What good is it?

The fact that Moose also provides a full fledged MOP which can be used for clean introspection, reflection and manipulation of objects/classes is actually just a side effect of those other things. I needed to create the MOP in order to provide those other features.

The distinction between MOP and Moose will obviously be very clear to you. You use the phrase "a full fledged MOP" with an alacrity that pre-supposes that I will know what a "MOP" is in this context.

So you see, if the question was naively worded, it's perhaps because I am naive on this subject. I did expect the clone argument to come up, along with the IV/UV/NV/PV case--the JIT took me by surprise--but I didn't want to respond to those "special cases", until I'd received a few replies detailing the kind of use-cases that I think are questionable. (As opposed to those, like extending Perl's closed, built-in classes for which it is the only mechanism available.) I tried to defer my response to you, but you just kept popping up everywhere.

The use cases I was expecting (hoping for; now dashed), fall into--that is, I currently, tentatively and perhaps naively, categorise into--two main categories:

Even the 'systems programmer use cases' can, in many, if not all instances, be achieved with compile-time decision taking and/or code generation. Again, from your statement:

FWIW, most of what Moose does is quite possible to be pushed into compile-time (the class building stuff) and we are actually working on trying to make that happen, ...

I would seem that you agree with this also. The question here becomes: Is is better to do so? (Hence the parens in "... be done (better) by compile-time decision taking". As you say, "it is not nearly as easy as you might think." and "In some cases, doing this can actually make the user level code more complex...".

And that identifies the kind of area of my naivity that I wish to improve. Where do the break points come?

Honestly I think you should rephrase your question,...

Perhaps you're right. Maybe I should start a new thread with a more carefully specified premise and try again. The problem with trying to do that the first time around was that I didn't (still don't) know exactly what my conclusions are going to be. So, the more targetted I make the question, the more likely I am to pre-bias it to a particular type of response. But, with the hindsight of this thread, maybe that would not be such a bad thing.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re^6: Runtime introspection: What good is it?

Replies are listed 'Best First'.
Re^7: Runtime introspection: What good is it?
by stvn (Monsignor) on Jul 07, 2008 at 13:42 UTC
    MOP. (Whatever that is.)

    It stands for "Meta Object Protocol", it is basically the API to the object system itself. Why not just say "API to the object system", well, the term is taken from CLOS (Common Lisp Object System) and Class::MOP has more of a ring to it then Class::API::To::The::Object::System::I::Just::Wrote. If you want to learn more about MOPs, you can read The Art of the Meta Object Protocol online, it is an amazingly eye opening book, the first three chapters are well worth reading through.

    -stvn