chromatic wrote: >How do you use keyword hooks to add 'method' to the imports of feature.pm? You don't. But there's no reason for your particular version of "method" to be controlled by feature.pm. > * grabbing the optree *already generated* for the body of the sub No. You add the pad entry *before* parsing the body. It's not as difficult as you make out. > You could use as >much existing code as possible (code that knows how to build an optree, code >that knows how to create lexicals, code that knows how to decide $self is >lexical, et cetera). The code that you're referring to there doesn't just generate ops and pad entries, it also parses general Perl code, in which (for example) "shift" could mean all sorts of things. Using lex_stuff, your implementation is liable to be broken by local redefinition of a keyword that doesn't appear in the user's source. That's OK for a prototype, but not at all OK for a serious language feature. -zeframThread Previous | Thread Next