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

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

Thread Previous | Thread Next
Branislav Zahradník
May 31, 2022 21:07
Re: Pre-RFC: syntax for quote-words-arrayref
Message ID:
On Tue, 31 May 2022 at 09:41, 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 ];

There is also another issue with qw - force it to treat commas as intended

Alternative: why not using already established pattern of modifiers?

arrayref: qw[ foo ]r
hashref: qw{ foo }r (though I will not include this at all)
interpolate: qw[ foo $i ]i

    $a = qz:d[ a b c ];     # 'd' says delimiter determines type, arrayref
>     $h = qz:d{ ...   };     # hashref
>     @a = qz:d( a b c );     # list, i.e. like qw( ... )
as long as IDENTIFIER COLON pattern is used for labels, these examples will
match differently (ie, whitespace will become significant)

qz :d(1)
qz: d(1)

so would you also prohibit qz as label?

Best regards,

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