- The
1 swap
is wrong.?do
wants the lower bound at the top of the stack. - The
loop
body is wrong. The two bounds are removed from the data stack, so your use ofrot
to access the exponentiation base doesn't work.
: myexp ( u1 u2 -- u3 ) \ u3 = u1^u2
over swap 1 ?do over * loop nip ;