[Catalyst] what is the type of $context?

A. Pagaltzis pagaltzis at gmx.de
Sat Jun 10 03:56:49 CEST 2006


* Yuval Kogman <nothingmuch at woobling.org> [2006-06-09 18:50]:
> WTF? Perl is possibly the most lax and free minded language
> there is WRT inrospection. You can even hack in meta classes if
> you try hard enough.
> 
> What other language lets you poke around the instance's
> structure, know it's class at runtime, and has a hash as a
> symbol table?

Perl is not very introspectable. Well, you can introspect things,
but it isn’t very declarative. You can get a list of functions
defined in a package, but that isn’t the same as getting a list
of methods for an object. This is much like you can’t
programmatically tell how many parameters a function takes and
what it expects them to be. Also, if AUTOLOAD is being used, then
the author of that package has to remember to write a custom
`can` method. Also, there is no way to declare a method private,
even though the underscore is widely followed; going by
underscore is a heuristic, “which is a fancy way of saying it
doesn’t work.” Etc. etc. etc. There are innumerable edge and
corner cases when you try to introspect Perl. It’s certainly
doable, but it’s certainly also anything but easy and almost
never 100% solid. Much like only perl can parse Perl, in a way.

This is one of those things that language peers of Perl do better
right now, and which Perl 6 is going to fix in a Really Big Way.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list