Skip Menu |
Report information
Id: 126569
Status: resolved
Priority: 0/
Queue: perl6

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

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



Subject: xx-repeated expression enclosed in parens can't access the topic $_ of a statement modifier
Download (untitled) / with headers
text/plain 569b
This works: ➜ .pick xx 10 given 1..6 (6 3 1 1 5 1 6 3 4 2) But putting parens around the xx operation, breaks it: ➜ (.pick xx 10) given 1..6 ((Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any)) The problem only seem to occur when $_ was set by a statement modifier - not when it was assigned to manually or set by the block form of 'given'. An example of a useful idiom which relies on putting parens around an xx operation, is (EXPRESSION xx *).first(CONSTRAINT) for "keep retrying EXPRESSION until the result matches CONSTRAINT".
Subject: [BUG] xx-repeated expression enclosed in parens can't access the topic $_ of a statement modifier
Likely related to RT #128054.
Download (untitled) / with headers
text/plain 140b
Still present in This is Rakudo version 2017.05-134-g0c5fe56cc built on MoarVM version 2017.05-25-g62bc54e9 implementing Perl 6.c.
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 822b
On Thu, 05 Nov 2015 01:58:17 -0800, smls75@gmail.com wrote: Show quoted text
> This works: > > ➜ .pick xx 10 given 1..6 > (6 3 1 1 5 1 6 3 4 2) > > But putting parens around the xx operation, breaks it: > > ➜ (.pick xx 10) given 1..6 > ((Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any)) > > The problem only seem to occur when $_ was set by a statement modifier > - not when it was assigned to manually or set by the block form of > 'given'. > > An example of a useful idiom which relies on putting parens around an > xx operation, is > (EXPRESSION xx *).first(CONSTRAINT) > for "keep retrying EXPRESSION until the result matches CONSTRAINT".
Thank you for the report. This is now fixed. Fix: https://github.com/rakudo/rakudo/commit/1ee89b54074e80c Test: https://github.com/perl6/roast/commit/2f2998733a2d8132c


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