4 ms·
Sure. In J: i.2+$i.3 0 1 2 3 4 That's "i. 2 + $ i. 3" (iota 2 plus shape_of iota 3), which parses as i.(2 + $(i. 3)). iota returns an array from 0
by silentbicycle 16y ago
Sure. In J:
i.2+$i.3
0 1 2 3 4
That's "i. 2 + $ i. 3" (iota 2 plus shape_of iota 3), which parses as i.(2 + $(i. 3)). iota returns an array from 0 to n, + adds, shape_of returns the dimensions of a array/matrix/n-dimensional matrix/etc. + is a binary operator ("dyad"), i. and $ are unary operators ("monads", no relation to Haskell).
- silentbicycle 16y ago(Oops. Misread your comment, and missed the edit window. Nevermind.)