f1=: 13 :'+/ x ^ i.y'

  f2=:  3 :'+/ x ^ i.y'  NB. Same (?) verb using explicit instead of tacit

  3 f1 4      NB. Expect (3^0) + (3^1) + (3^2) + (3^3) = 40
40

  3 f2 4      NB. Expect (3^0) + (3^1) + (3^2) + (3^3) = 40
|domain error: f2
|   3     f2 4

  f1
[: (+/) ([ ^ ([: i. ]))

  f2
3 : '+/ x ^ i.y'


  +/ 3 ^ i.4    NB. Execute equivalent of f2 and get correct result
40

_________________________________________________________________
The next generation of Hotmail is here! http://www.newhotmail.co.uk/

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to