develooper Front page | perl.perl5.porters | Postings from December 2017

Re: Urgent subroutine signatures problems

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
December 13, 2017 17:26
Subject:
Re: Urgent subroutine signatures problems
Message ID:
20171213172603.539b2c90@shy.leonerd.org.uk
On 13 Dec 2017 16:53:49 -0000
Father Chrysostomos <sprout@cpan.org> wrote:

> No.  Unlike prototypes, signatures are properly parsed, allowing
> things like ($a=")"), and even ($a=do{ BEGIN { ... } }), which pretty
> much rules out any two-pass parsing.

Ah; in that case I guess the only real option is to allow :lvalue
upfront, before the signature then.

  sub foo :lvalue ($self) { $self->{foo} }

I wonder, would that look better ordered

  sub :lvalue foo($self) { $self->{foo} }

perhaps?

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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