Re: Glib::Object->methods take a look at this...
- From: "A. Pagaltzis" <pagaltzis gmx de>
- To: Gtk-Perl-List <gtk-perl-list gnome org>
- Subject: Re: Glib::Object->methods take a look at this...
- Date: Thu, 18 Sep 2003 15:50:58 +0200
* Ross McFarland <rwmcfa1 neces com> [2003-09-18 01:10]:
searched for 'list perl object methods' on google and saw
something that looked promising,
http://dev.perl.org/rfc/335.html. about 1 min 30 seconds latter
i had it added to Glib.pm under the package Glib::Object and it
worked.
Well that *is* old hat. :) And it has multiple weaknesses. First,
it can't tell class methods from instance methods - worse, it
can't tell simple package functions from methods at all. It won't
work very well for modules with mixed interface style. Second,
there is absolutely no way to infer what happens if you call
$obj->foo if a) sub foo does not exist but b) sub AUTOLOAD does..
So this approach is okay if you stick to some sort of
convention(s) for naming functions and maybe a convention for
where to describe in some datastructure what AUTOLOAD does.
But for the general case, it's about useless and in fact there's
no solution at all.
But grokking packages/symbol tables can never hurt, anyway. When
you're bored next time, take Data::Dumper to some symbol tables
(particularly %main::), and see what insight you can find. :)
It's quite educational. (Did you know you can use symbolic
references under ref stricture? Of course it isn't *easy* - that
would be cheating.)
--
Regards,
Aristotle
"If you can't laugh at yourself, you don't take life seriously enough."
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]