# New Ticket Created by  "brian d foy" 
# Please include the string:  [perl #132710]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=132710 >


I was playing with higher orders of multiplication and defining some
operators for them. When I try to make one of my new operators tighter
than one I've already defined:

    multi infix:<↑> ( Int:D $n, Int:D $m  --> Int:D )
        is assoc<right>
        is tighter(&infix:<**>)
        { $n ** $m }

    multi infix:<↑↑> ( Int:D $, 0 --> Int:D )
        is assoc<right>
        is tighter(&infix:<↑>)
        { 1 }

    multi infix:<↑↑> ( Int:D $n, Int:D $m  --> Int:D )
        is assoc<right>
        is tighter(&infix:<↑>)
        { [↑] $n xx $m }

    put 2 ↑  3;  # 2  * 2  * 2 =  8
    put 2 ↑↑ 3;  # 2 ** 2 ** 2 = 16

This gets the odd error about something that's not part of my code:

    ===SORRY!=== Error while compiling /Users/brian/Desktop/knuth2.p6.pl
    No such method 'subst' for invocant of type 'Any'

The problem turns out to be my duplication of the tighter. That's
better left to a proto definition instead of the candidates. I know
that now but the error message could have helped with that.

-- 
brian d foy <brian.d....@gmail.com>
http://www.pair.com/~comdog/

Reply via email to