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

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

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



Subject: Match object inside .comb is weird (‘789’.comb(/ . {say $/} <!> /))
To: rakudobug [...] perl.org
Date: Sun, 27 Nov 2016 04:36:15 +0200
From: Aleks-Daniel Jakimenko-Aleksejev <alex.jakimenko [...] gmail.com>
Download (untitled) / with headers
text/plain 444b
Code:
dd ‘789’.comb(/ . {say $/} <!> /)'

Result:
「7」
「7」
「7」
slip()

It may seem like it is stuck on ‘7’ and does not progress at all. However, if we add parens around . we will get this:

Code:
dd ‘789’.comb(/ (.) {say $/} <!> /)

Result:
「7」
 0 => 「7」
「8」
 0 => 「8」
「9」
 0 => 「9」
slip()


I do not understand why the first snippet prints 「7」 three times.
This was fixed during the uncurse merge. Bisect log (20 candidates): https://gist.github.com/7cedc2e2e35913544f75bc5fc89bd088

「testneeded」

On 2016-11-26 18:36:35, alex.jakimenko@gmail.com wrote:
Show quoted text
> *Code:*
> dd ‘789’.comb(/ . {say $/} <!> /)'
>
> *Result:*
> 「7」
> 「7」
> 「7」
> slip()
>
> It may seem like it is stuck on ‘7’ and does not progress at all. However,
> if we add parens around . we will get this:
>
> *Code:*
> dd ‘789’.comb(/ (.) {say $/} <!> /)
>
> *Result:*
> 「7」
> 0 => 「7」
> 「8」
> 0 => 「8」
> 「9」
> 0 => 「9」
> slip()
>
>
> I do not understand why the first snippet prints 「7」 three times.




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