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

Re: Urgent subroutine signatures problems

Thread Previous | Thread Next
From:
Dan Book
Date:
December 24, 2017 19:26
Subject:
Re: Urgent subroutine signatures problems
Message ID:
CABMkAVU_gzHqSP3JUHba3W1s19cABbQ2WYFr9aCSGzYtAjkF+g@mail.gmail.com
On Thu, Dec 21, 2017 at 1:21 PM, Sawyer X <xsawyerx@gmail.com> wrote:

>
>
> On 12/14/2017 06:10 AM, Father Chrysostomos wrote:
> > Paul Evans wrote:
> >> 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} }
> > Yes.  I this is my (and Zefram's) preferred syntax, because it
> > stresses the fact that the signature is actually part of body, just
> > written shorthand.
>
> This is simpler to resolve. We can allow subroutine attributes before
> and after.
>
> The biggest problem is disambiguating from prototypes.
>

Sorry if I missed it, but is there any reason not to only allow all
attributes before the signature (as presumably it originally was)? It seems
the simplest solution in both implementation and documentation.

-Dan

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