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

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

Thread Previous | Thread Next
From:
Branislav Zahradník
Date:
May 31, 2022 21:07
Subject:
Re: Pre-RFC: syntax for quote-words-arrayref
Message ID:
CAB=rbOmoLXsyjxrGQx+pDfr3U-Tf120E3c_Ep4M=NQSjTDq3zw@mail.gmail.com
On Tue, 31 May 2022 at 09:41, Neil Bowers <neilb@neilb.org> 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
token

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)
qz:d(1)

so would you also prohibit qz as label?

Best regards,
Brano

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