Front page | perl.perl5.porters |
Postings from November 2019
Re: Named Parameters
From:
Paul "LeoNerd" Evans
Date:
November 30, 2019 15:30
Subject:
Re: Named Parameters
Message ID:
20191130153014.088b0dd5@shy.leonerd.org.uk
I am cautiously optimistic on this one.
On Thu, 28 Nov 2019 17:01:42 +0000
Dave Mitchell <davem@iabyn.com> wrote:
...
> In terms of characters, the following are already taken, or might
> be taken under some of the other proposals:
>
> $ @ % sigils
> \ * aliasing
> ? query parameter
> , ) signature syntax
> # comment
>
> Personally I think we should stick with ':'.
I agree there aren't many characters left, but I wonder if this feature
combined with attributes both using the colon, might get into any
syntax ambiguities? There is already the existing collision between
colon for sub arguments vs. named labels, which causes
sub :attr { code here }
to either parse as an attributed anonymous sub, or as a labeled call to
attr() with a hashref constructor.
It may be useful to stare carefully at both these features in
combination to satisfy ourselves it won't be ambiguous.
--
Paul "LeoNerd" Evans
leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/