in reply to [Perl6] [+] on a list... with a Junction

Hi, It's just a bug and sum is too eager about restricting the types to numeric. If you report it, I'll take a look in the next couple of days. Just email to rakudobug@perl.org

EDIT: never mind. Just fixed it in https://github.com/rakudo/rakudo/commit/8d04bec

Replies are listed 'Best First'.
Re^2: [Perl6] [+] on a list... with a Junction
by m_turner (Sexton) on Nov 24, 2016 at 03:42 UTC
    Thank you for the mention and the bug fix. I was waiting to get back to my computer to write up the bug report (something, something, work computer, personal email).

    I'm not yet familiar enough with the code base to be certain, but I wonder if that change will resolve the tangential bug(?) of say [+] (1, 2|3, 4); (does it do magic to map [+] to .sum?)

      Yeah, that is fixed as well. The [+] metaop is special-cased to become sum() since it's pretty common and we have other optimizations for .sum, like the one on Range objects for example:

      say sum 1..999999999999999999999999999; # 499999999999999999999999999500000000000000000000000000