New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Order of is assoc
and precedence traits matter, but should it?
#6663
Comments
From @briandfoyI originally asked this on StackOverflow: https://stackoverflow.com/q/48219788/2766176 This fails to be right associative: sub infix:<↑> ( Int:D \n, Int:D \m --> Int:D ) put "2**2**2**2 = ", 2**2**2**2; Reversing the traits fixes that: sub infix:<↑> ( Int:D \n, Int:D \m --> Int:D ) I didn't see anything in the docs about the ordering of traits but As far as I can tell the precedence still works when it's specified first: sub infix:<↑> ( Int:D \n, Int:D \m --> Int:D ) put "2↑3**4↑2 = ", 2↑2**2↑2; put "2↑3*4↑2 = ", 2↑2*2↑2; put "2↑3+4↑2 = ", 2↑2+2↑2; How is this supposed to work? Should either way work? I can easily sub infix:<↑> ( Int:D \n, Int:D \m --> Int:D ) |
From @zoffixznetOn Fri, 12 Jan 2018 00:02:34 -0800, comdog wrote:
I pushed a fix to a branch[^1] as it appears to be blocked by RT#132711. More precisely, the fix fixes `is equiv` to *copy* associativity (per speculation[^2] and original[^3] behaviour). So in your code that would make it work right only on accident as `&infix:<**>` is right-associative. I also opened a doc issue to document that is equiv/tighter/looser set associativity as well as precedence. [1] rakudo/rakudo@6f5b27ce63 |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#132713 (status was 'open')
Searchable as RT132713$
The text was updated successfully, but these errors were encountered: