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

Re: Pre-RFC: syntax for quote-words-arrayref

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
June 7, 2022 14:20
Subject:
Re: Pre-RFC: syntax for quote-words-arrayref
Message ID:
Yp9eiwzO+ZnwS+bw@iabyn.com
On Tue, May 31, 2022 at 08:40:52AM +0100, Neil Bowers wrote:
> In early March last year, I proposed[1] new syntax for "quote words arrayref",
> so that the following:
> 
>     $a = [qw/ a b c /];
> 
> could be replaced with:
> 
>     $a = qa[ a b c ];

My personal feeling is that that it adds complexity for very little gain.
If people want an array ref they just wrap the qw() in []'s. It's visually
obvious then that an array ref is being created.

With qa() you now require programmers to remember another fact. Each
little fact on its own isn't a great burden, but perl has accumulated
zillions of such factlets, which cummulatively make perl hard to use.

Now you will have things like

    foo(qw(a b c));
    foo(qa(a b c));

doing two completely different things, and the programmer may get confused.
People already find qw() confusing enough - e.g. whether it parses commas;
now they will have to remember whether qa() obeys the same parsing rules
as qw(). Etc.


-- 
Modern art:
    "That's easy, I could have done that!"
    "Ah, but you didn't!"

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