Although the APL90 paper http://www.jsoftware.com/papers/J1990.htm does not refer to "key", I tried some "key" expressions just now in the J1990 shareware version distributed at APL90, and I got:
1 1 2 1 3 </. 'abcde' ┌───┬─┬─┐ │abd│c│e│ └───┴─┴─┘ 1 1 2 1 3 +//. 100*1 2 3 4 5 700 300 500 So "key" was introduced quite early, sometime between the submission of final copy for APL90 and the time of the conference, August 13-17, 1990. ----- Original Message ----- From: Roger Hui <[email protected]> Date: Tuesday, May 17, 2011 19:06 Subject: Re: [Jprogramming] Aggregation To: Programming forum <[email protected]> > The cited article has the passage: > > The key adverb was not in the initial version of J. > It came in later at the request of the J user community, > notably Joey Tuttle. > > This is not consistent with what I remember. > I first saw the idea in the 1980s in > the documentation for the Connection Machine, > http://en.wikipedia.org/wiki/Connection_Machine > which had a machine instruction for doing > x f//.y for a small set of functions f and certain x's. > In any case, the October 1990 dictionary > had u/. with the same definition as now. > (The earliest public version of J, available > at APL90, was dated July 1990. > http://www.jsoftware.com/papers/J1990.htm > That version did not have "key".) > > In any case, it is true that many case of the > special code for u/. are "JKT specials", > implemented in response to code Joey posted > or in expectation that they would be useful > for what he does. > > > > ----- Original Message ----- > From: "Lettow, Kenneth" <[email protected]> > Date: Tuesday, May 17, 2011 17:37 > Subject: Re: [Jprogramming] Aggregation > To: Programming forum <[email protected]> > > > Ian, > > > > I best understood key after reading a book you edited ;-) > > > > To summarize... http://www.jsoftware.com/jwiki/Doc/Articles/Play151 > > > > All the best, > > > > Ken > > > > -----Original Message----- > > From: [email protected] > > [mailto:[email protected]] On Behalf Of Ian Clark > > Sent: Tuesday, May 17, 2011 5:09 PM > > To: Programming forum > > Subject: [Jprogramming] Aggregation > > > > I'm being lazy here. But I need a better answer than I can > devil out > > myself. It occurs in a recent submission to Vector... > > > > I have an array like this (which may be unsorted, and can grow very > > large): > > > > 1 100 > > 1 100 > > 1 20 > > 1 400 > > 2 30 > > 2 200 > > 2 300 > > 33 100 > > 33 100 > > 33 100 > > > > I want to collapse it to: > > > > 1 620 > > 2 530 > > 33 300 > > > > i.e. summing over subheadings. > > The original example had A B C in place of 1 2 33, but > > numbers will > > do, to save boxing. We don't know the full set of A B C ... in > > advance. Nothing to be assumed about the first column, except > it is > > +ve integers. But I'm also interested in the case where the first > > column lies in the set: i.(n) for some n>0. In other words > they > > can be > > squashed up. > > > > 1. There's simply got to be a "jem" to do it. Suggestions, please. > > - Transpose the array if you wish. Box it: 1 100 ; 1 100 > ; 1 20 > > ; ... > > -whatever. > > - No, of course I don't want a looping solution :) > > > > 2. What do you call this process? I call it "aggregation" -- > but I > > think the name differs across disciplines. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
