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

Re: Urgent subroutine signatures problems

Thread Previous | Thread Next
From:
Sawyer X
Date:
December 23, 2017 16:28
Subject:
Re: Urgent subroutine signatures problems
Message ID:
314fad36-f89f-f7ab-09c1-b4a85cb8e646@gmail.com


On 12/21/2017 11:45 PM, Father Chrysostomos wrote:
> Sawyer X 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.
> But what do we do with attributes that affect compilation?  Should we
> croak when the attribute is seen after the signature?  That would be
> the cleanest way I think.

One way. And it might be the cleanest. (Other than moving the signatures
past attributes.)


>
>> The biggest problem is disambiguating from prototypes.
> I consider that problem already solved, via the :prototype attribute.

What Zefram said.

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