develooper Front page | perl.perl5.porters | Postings from January 2011

Re: [PATCH] use feature 'method'; (was Re: Proposal: "$->" forimplicit invocant)

Thread Previous | Thread Next
January 20, 2011 10:32
Re: [PATCH] use feature 'method'; (was Re: Proposal: "$->" forimplicit invocant)
Message ID:
chromatic wrote:
>This proof of concept patch enables that, with $self as the invocant.  It 
>could use more robust testing, but all existing tests pass.

You should prototype this as a CPAN module, using the keyword hook.

>The trick of using lex_stuff_pvs() seems grotty, but it's far, far easier than 
>building a new optree with the appropriate lexical bindings within the method 
>production in perly.y.

As something to go in the core, I do not approve of this shortcut.
You should definitely build the optree rather than stuff source.

It also seems very unwise for the core to take the keyword "method" at
this stage.  We have several CPAN modules supplying "method" keywords
with various semantics, it's an unresolved area.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About