The zero-padding is happening because i. acts on each row but returns different shaped results for each row. Try this: i.&.> <"1[2 2 $ 1 2 3 4
This will give boxed results of the correct shape for each row. Another example of this kind of zero-padding is q: 5 100000 q: will get the prime factors of each number. 5 only has one factor, itself, whereas 100000 has many factors. J will zero pad the result of q: 5 to match the shape of q: 100000. Doing something like this: q:&.> <"0[ 5 100000 will give non-zero-padded results. The results are boxed. -------------------------------------------- On Wed, 12/13/17, TongKe Xue <[email protected]> wrote: Subject: [Jprogramming] i. (2 2 $ 1 2 3 4) To: [email protected] Date: Wednesday, December 13, 2017, 7:49 AM Hi, I understand what (2 2 $ 1 2 3 4) does. I understand what i. 1 2 does I understand what i. 3 4 does. I have read http://www.jsoftware.com/help/jforc/loopless_code_i_verbs_have_r.htm#_Toc191734331 I understand the concept of verb-rank, of frames + cells, of "promoting one frame to another if they share the same prefix." I don't understand how the 0 padding in i. (2 2 $ 1 2 3 4) works What is the mechanism by which 0-padding is happening? Thanks, --TongKe ==== 2 2 $ 1 2 3 4 1 2 3 4 i. 1 2 0 1 i. 3 4 0 1 2 3 4 5 6 7 8 9 10 11 i. (2 2 $ 1 2 3 4) 0 1 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
