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

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

Thread Previous | Thread Next
From:
Veesh Goldman
Date:
March 13, 2021 18:57
Subject:
Re: Perl feature wish: quote-word array-ref operator
Message ID:
CAO-W_8BJh7iRrDs=-O+ZSFi546rvVVkKn84OSjMBQ_AGqaGNeA@mail.gmail.com
Maybe the attributes could go after a space, which isn't a valid quoting
character. So you could have

    qw :xid[
         banana
         $chocolate # hmmm...
         others
    ];

Although that's inconsistent with how attributes work in general

On Sat, Mar 13, 2021, 19:38 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///
>
> --
> H.Merijn Brand  https://tux.nl   Perl Monger   http://amsterdam.pm.org/
> using perl5.00307 .. 5.33        porting perl5 on HP-UX, AIX, and Linux
> https://tux.nl/email.html http://qa.perl.org https://www.test-smoke.org
>
>

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