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

Re: Named argument syntax (was Re: PSC #049 2022-01-07)

Thread Previous | Thread Next
Juerd Waalboer
January 24, 2022 11:34
Re: Named argument syntax (was Re: PSC #049 2022-01-07)
Message ID:
Dan Book skribis 2022-01-24  0:02 (-0500):
>>      # but:
>>      f(name = "value");
>>      f name = "value";
>This syntax is already valid and could be used to assign to an lvalue sub
>(though doesn't seem likely to be common).

Good point, thanks for pointing that out. I didn't realize lvalue non-method subs were a thing because I've only ever used lvalue methods.

This means that implementing my proposal would break backward compatibility. I don't know how common lvalue subs are and if such breakage would be considered acceptable.

The lvalue sub assignment could remain available in subroutine arguments as:

     f name() = "value";
Met vriendelijke groet, // Kind regards, // Korajn salutojn,

Juerd Waalboer  <>

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