[perl #126569] [BUG] xx-repeated expression enclosed in parens can't access the topic $_ of a statement modifier

[email protected] ("Zoffix Znet via RT")
Newsgroups perl.perl6.compiler
Message-ID <[email protected]>
On Thu, 05 Nov 2015 01:58:17 -0800, [email protected] wrote:
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.