Skip Menu |
Report information
Id: 131102
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [REGRESSION] anonymous variables are no longer working as expected in regex code blocks
Download (untitled) / with headers
text/plain 241b
Code: (^10).grep: /^ <?{ say $++ }> / Result (2015.12,2016.10): 0 1 2 3 4 5 6 7 8 9 Result (2016.11,HEAD(099512b)): 0 0 0 0 0 0 0 0 0 0 Bisectable points to https://github.com/rakudo/rakudo/commit/7a456ff80183a6e26dc91d811d992112c68ddb6d
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 610b
On Tue, 04 Apr 2017 18:43:14 -0700, alex.jakimenko@gmail.com wrote: Show quoted text
> Code: > (^10).grep: /^ <?{ say $++ }> / > > Result (2015.12,2016.10): > 0 > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > > Result (2016.11,HEAD(099512b)): > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > > > Bisectable points to > https://github.com/rakudo/rakudo/commit/7a456ff80183a6e26dc91d811d992112c68ddb6d
A state variable works per closure clone, but we must re-clone the inner blocks in a regex to avoid threads stomping on each other's state. So this only "worked" previously thanks to a code-gen bug, which I fixed in the referenced commit.
Which basically means that state variables are useless in this case. Is there any potential possibility to detect this and print some kind of a warning?

On 2017-04-07 05:34:38, jnthn@jnthn.net wrote:
Show quoted text
> On Tue, 04 Apr 2017 18:43:14 -0700, alex.jakimenko@gmail.com wrote:
> > Code:
> > (^10).grep: /^ <?{ say $++ }> /
> >
> > Result (2015.12,2016.10):
> > 0
> > 1
> > 2
> > 3
> > 4
> > 5
> > 6
> > 7
> > 8
> > 9
> >
> > Result (2016.11,HEAD(099512b)):
> > 0
> > 0
> > 0
> > 0
> > 0
> > 0
> > 0
> > 0
> > 0
> > 0
> >
> >
> > Bisectable points to
> > https://github.com/rakudo/rakudo/commit/7a456ff80183a6e26dc91d811d992112c68ddb6d
>
> A state variable works per closure clone, but we must re-clone the
> inner blocks in a regex to avoid threads stomping on each other's
> state. So this only "worked" previously thanks to a code-gen bug,
> which I fixed in the referenced commit.




This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org