Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^5: Class::InsideOut - yet another riff on inside out objects.

by diotalevi (Canon)
on Dec 19, 2002 at 12:28 UTC ( #221093=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Class::InsideOut - yet another riff on inside out objects.
in thread Class::InsideOut - yet another riff on inside out objects.

Oh ok. I was expressing more of a generalized ability so I might combine that with a search of all the contexts I could find on the symbol table as well. Very slow, not the right approach but still doable. So that'd just have to go all around and collect the pads from every visible code reference and I'm thinking that eventually you hit the right one...


Fun Fun Fun in the Fluffy Chair


Comment on Re^5: Class::InsideOut - yet another riff on inside out objects.
Re^6: Class::InsideOut - yet another riff on inside out objects.
by adrianh (Chancellor) on Dec 19, 2002 at 13:07 UTC

    Darn. I hoped there was something obvious I was missing :-)

    While scanning all coderefs & symbol table entries might work for a lot of cases, I don't think it is completely general. For example, consider:

    { package Foo; use base qw(Class::InsideOut); sub new { return bless [], shift }; { my %foo : Field }; };

    There are no subroutines that have %foo in their scope so, without generating code with a source filter, I can see no way of getting access to the pad with "%foo" in it.

        No. Foo::new is not in %foo's scope.

        It also doesn't reference %foo - which probably means it would be optimised out of the pad even if it was in scope (not 100% on the details of this sort of optimisation so I could be wrong about that).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://221093]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-07-31 23:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (255 votes), past polls