develooper Front page | perl.perl5.porters | Postings from March 2021

Re: Perl feature wish: quote-word array-ref operator

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
March 5, 2021 17:48
Subject:
Re: Perl feature wish: quote-word array-ref operator
Message ID:
20210305174819.0e41de6b@shy.leonerd.org.uk
On Fri, 5 Mar 2021 16:05:29 +0000
Philip R Brenan <philiprbrenan@gmail.com> wrote:

> Even better :
> 
> use autoref; my $a = qw(a b c);  is_deeply $a, ['a','b','c'];
> 
> which opens the way to making sigils optional by making % and @
> unnecessary.

Under your feature, does

  func(qw( a b c ));

pass 3 strings, or 1 arrayref containing them?


We've already seen that context-sensitive grammar and semantics aren't
a good choice in Perl [e.g. see  my $x = @_; vs my ($x) = @_;]. Lets
not add any more confusion to the mix.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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