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

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

Thread Previous | Thread Next
From:
Zefram
Date:
January 20, 2011 10:32
Subject:
Re: [PATCH] use feature 'method'; (was Re: Proposal: "$->" forimplicit invocant)
Message ID:
20110120183236.GL18163@lake.fysh.org
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.

-zefram

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About