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
From:
Juerd Waalboer
Date:
January 24, 2022 11:34
Subject:
Re: Named argument syntax (was Re: PSC #049 2022-01-07)
Message ID:
20220124113444.GL7670@k
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  <juerd@tnx.nl>
TNX

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