You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<flussence> rn: multi infix:<%>($lhs, Str $rhs) is looser(&infix:<xx>)
{ $lhs.join: $rhs }; say '........' xx 8 % "\n"
<camelia> rakudo b2072f, niecza v24-66-gaee6525: OUTPUT«........
........ ........ ........ ........ ........ ........ ........»
<flussence> those \s'es should be \n's...
<colomon> that doesn't seem to have worked?
<flussence> rn: multi infix:<%>($lhs, Str $rhs) is looser(&infix:<xx>)
{ $lhs.join: $rhs }; say ('........' xx 8) % "\n"
<camelia> rakudo b2072f, niecza v24-66-gaee6525:
OUTPUT«................................................................»
<timotimo> yeah, because of $ instead of @
<colomon> oh, nevermind
<timotimo> for the $lhs ;)
<masak> timotimo: should still work, no?
<masak> so, why doesn't it work for @lhs ?
<moritz> ah, I know what's going on
<quietfanatic> r: multi infix:<%>(\lhs, Str $rhs) { say "custom op";
lhs.join: $rhs }; say ( infix:<%>('........' xx 8, "\n") ).perl
<camelia> rakudo b2072f: OUTPUT«custom
op"........\n........\n........\n........\n........\n........\n........\n........"»
<timotimo> oh, facepalm.
<moritz> since there's already an infix %, you can't define a new one
with a different precedence
<flussence> oh!
<moritz> so the precedence spec is simply ignored
<quietfanatic> oh, I think it'd be nice if you could do that
<timotimo> traits can be applied to the proto only?
<quietfanatic> or wait, is it because it's installing it as a multi?
<timotimo> can only be applied to the proto*
<quietfanatic> I see
<benabik> Multis with different precedence is probably a bad idea.
<quietfanatic> r: sub infix:<%%%>(\lhs, Str $rhs) is
looser(&infix:<xx>) { say lhs.perl; lhs.join: $rhs }; say ('........'
xx 8 %%% "\n" )
<camelia> rakudo b2072f: OUTPUT«("........", "........", "........",
"........", "........", "........", "........",
"........").list................................................................»
<quietfanatic> you're right
<masak> could there maybe be a warning if you try to override the precedence?
<masak> it feels wrongish that it just throws it away.
<colomon> masak: I think an error, even
* masak submits rakudobug
<masak> colomon: better? :)
<colomon> masak++
Migrated from rt.perl.org#118339 (status was 'new')
Searchable as RT118339$
The text was updated successfully, but these errors were encountered: