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

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

Thread Previous | Thread Next
From:
Christian Walde
Date:
March 14, 2021 17:10
Subject:
Re: Perl feature wish: quote-word array-ref operator
Message ID:
op.0z88ntt2ydyjqt@xenwide.vpn.udag.de
On Sat, 13 Mar 2021 18:37:44 +0100, H.Merijn Brand <perl5@tux.freedom.nl> wrote:

> On Sat, 13 Mar 2021 13:10:06 +0000, "Paul \"LeoNerd\" Evans"
> <leonerd@leonerd.org.uk> wrote:
>
>> On Fri, 12 Mar 2021 22:11:53 -0500
>> "Ricardo Signes" <perl.p5p@rjbs.manxome.org> wrote:
>>
>> > Raku attacked this by putting its modifiers in the beginning.  If we
>> > could prepare to do this extensibly, even if only with core-provided
>> > extensions, and even with very few to start, we'd be in a good
>> > place.
>> >
>> > This example is meant to make the point, not to be exactly what we
>> > want:
>> >
>> > qz:d[ ... ]      # :d means "delimiter determines type" so this gets
>> > an arrayref qz:d{ ... }      #    ...same thing, but we get a
>> > hashref
>>
>> Perhaps we could prepare for it by declaring as "discouraged" and
>> eventually deprecated, the use of : as a qq()-like delimiter?
>>
>> While currently it is valid to
>>
>>   print qq:Hello, world\n:;
>>
>> I suspect in practice very few cases will come up that we -might-
>> consider it worthwhile to carve out that little space, similar to the
>> \{ in regexp.
>
> I've seen both : and ! used a lot in regex delimiters
> I'm sure I used ':' myself a lot too in the early perl4-perl5
> transition period, but probably only with m// and s///

As long as it is gated by feature and version, i don't think it matters at all whether : is used as a delimiter in old code or not, as removing the ability to do that doesn't actually remove the ability to do a thing that can achieved only by that, other than a cosmetic consideration.

-- 
With regards,
Christian Walde

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