Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by adrianh (Chancellor)
on Dec 19, 2002 at 13:07 UTC ( #221100=note: print w/ replies, xml ) Need Help??


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

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.


Comment on Re^6: Class::InsideOut - yet another riff on inside out objects.
Download Code
Re^7: Class::InsideOut - yet another riff on inside out objects.
by diotalevi (Canon) on Dec 19, 2002 at 13:15 UTC

      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://221100]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (17)
As of 2014-08-27 21:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (253 votes), past polls