Why does 2(*i.)5
evaluate to 0 2 4 6 8
?
It's clear that 2*i.5
does, but the ()
creates a hook and evaluating from right to left it seems we get
(*i.)5 == 0 5 10 15 20
and 2 won't act on that list -- so where am I going wrong ?
Why does 2(*i.)5
evaluate to 0 2 4 6 8
?
It's clear that 2*i.5
does, but the ()
creates a hook and evaluating from right to left it seems we get
(*i.)5 == 0 5 10 15 20
and 2 won't act on that list -- so where am I going wrong ?
2 (* i.) 5
, is a dyadic hook, which translates to 2 * (i. 5)
.
(* i.) 5
, is a monadic hook, which translates to 5 * (i. 5)
.
The dyadic hook, x (u v) y
is equivalent to x u (v y)
, which is the same as x u v y
.
The monadic hook, (u v) y
is equivalent to y u (v y)
, which is the same as y u v y
.
x (u v) y
<--> x u (v y)
for dyadic hooks.
A use might be to reshape y into the shape x as shown at http://www.jsoftware.com/jwiki/Vocabulary/hook
[t=.i. 3 2
0 1
2 3
4 5
2 3 ($ ,) t
0 1 2
3 4 5