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

Re: Signature Defined-or assigments [was Re: Miscellaneoussuggestions]

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
November 19, 2022 14:54
Subject:
Re: Signature Defined-or assigments [was Re: Miscellaneoussuggestions]
Message ID:
20221119145412.48bfbe15@shy.leonerd.org.uk
On Sat, 19 Nov 2022 09:06:03 +0000
Dave Mitchell <davem@iabyn.com> wrote:

> I'm happy for you to proceed. Obviously I think the proposed syntax
> is a a good idea, since I proposed it(!) (having first stolen it), so
> I guess it would be be good to get feedback from others first.

I now have an initial PR at

  https://github.com/Perl/perl5/pull/20526

> I too am less bothered about the ||= variant, but I suggested it
> because it should be easy to implement while implementing //=, and so
> we might as well, for completeness.

The tricky part was reshaping the grammar rule so it returns an
OP_ARGDEFELEM, to make it easy to add the flags on it. Having done
that, recognising ||= as well was a tiny addition; so I added it while
there. I don't really plan to make a big thing of it in examples, docs,
etc.. but it's interesting while there.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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