I want to swap two array elements, and I am trying to do it by transposing indices. So far I have come up with
swapindices=:}: @: C. @: (; ~.) 10 swapindices 3 5 0 1 2 5 4 3 6 7 8 9 10 swapindices 3 9 0 1 2 9 4 5 6 7 8 3 10 swapindices 3 3 0 1 2 3 4 5 6 7 8 9 Is this a sensible approach, or I am missing something much simpler? Best wishes, John ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
