SortUp and GradeUp are both defined as /: in the primitives. In
parallel, SortDown and GradeDown also suffers the same issue.
Take the following example:
[data=. 1;1 2 3;1; 1 2
+-+-----+-+---+
|1|1 2 3|1|1 2|
+-+-----+-+---+
[wired=. # every data
1 3 1 2
If I use the standard dentition for gradeup, I would get the following:
/: wired
0 2 3 1
Which actually gives us the index to the proper sorting and to get the
actual data, you need to do another step which is:
wired {~ /: wired
1 1 2 3
Which is what I actually want. There is a shortcut to this which is to
use:
/:~ wired
1 1 2 3
So now, I feel that SortUp should be using /:~ and GradeUp should be /:
What do you guys think?
r/Alex
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm