Not sure I'm understanding your questions. Maybe including some of the expressions you've tried to illustrate your points would help?
Basically the left argument to Key is used to categorise/group the right argument. Each unique item of the left argument tags a grouping of items in the right argument. 'abadccb' </. 1 2 3 4 5 6 7 +---+---+-+---+ |1 3|2 7|4|5 6| +---+---+-+---+ The left argument itself is only used to group, it is not applied to the verb to the left of Key. It doesn't matter what form it is, just that the unique items correspond to the items in the right argument you want to group together 99 108 99 42 66 66 108 </. 1 2 3 4 5 6 7 +---+---+-+---+ |1 3|2 7|4|5 6| +---+---+-+---+ 'abadccb' +//. 1 2 3 4 5 6 7 4 9 4 11 Not sure if that helps... On Sat, Oct 12, 2019 at 1:48 PM 'Jim Russell' via Programming < programm...@jsoftware.com> wrote: > I had high hopes for the functions of Key (particularly #/.~ M) for > tallying the keys in a character matrix. Playing with it, and replacing > verb # with others (< or { or ;) just to try to better understand its > behavior, answered one question that I had: was this some serendipitous > marriage of a verb and an adverb, or some special code that needed some > un-useful combination of symbols to invoke. It seems to be the latter > (notice when I briefly considered trying “#” as a substitute verb). > > So a couple of new questions occurred: > > • Why insist that the arguments need to agree in size. Since the result > is the length of the Nub of x, which is typically less than the rows of the > arguments, who cares? > > * Why isn’t the typical behavior of dyadic iota followed, where arguments > of y not found in x are counted “off the end” of the size of the nub of x? > In that case, Y could be compared to a completely different x, perhaps > revealing no matches at all with a reset of vector of (0$#x),#y. (My J is > so poor I am probably saying that wrong, but hopefully you can guess what I > mean.) > > Would this improve the expression, or am I just flaunting my ignorance? > > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm