[UV=:0,(,-@|.)=i.3
0 0 0
1 0 0
0 1 0
0 0 1
0 0 _1
0 _1 0
_1 0 0
foo=: {{ x+ y{UV }} NB. constructed conform the diagram on
https://code.jsoftware.com/wiki/Vocabulary/fcap
$0 0 0 (]F:. foo) 3 2 _3
3 3 3 3 3
$0 0 0 (]F:. foo)~ 3 2 _3
3 3 3 3 3
foo=: {{ y+ x{UV }} NB. y and x are swapped, counterintuitive
$0 0 0 (]F:. foo) 3 2 _3
3 3
0 0 0 (]F:. foo) 3 2 _3 NB. this is the desired behaviour
0 0 1
0 1 1
0 1 0
$0 0 0 (]F:. foo)~ 3 2 _3
3 3
Also remarkable is that swapping the arguments seems not to influence the
result.
Any clarification?
R.E. Boss
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm