I am confused about the outcome of the latter expression 1 2 3 , 6
Now, intuitively, I am not confused about it all. It's just if I try to
follow the J dictionary to the letter:
http://jsoftware.com/help/dictionary/d320.htm
That I wonder about the result of 1 2 3 , 6
First let's go thru 1 2 3 , 0 $ 6
1. Reshaping an atomic argument to the shape of the items of the other,
So 1 2 3 is not atomic. 0 $ 6 is atomic? Hmm.. it's a shape-0 , rank-1
array isn't it? maybe it isn't atomic after all.... but anyway, I
thought it was, so my analysis continued:
We must shape 0 $ 6 to the shape of the ITEMS of 1 2 3.
the items of 1 2 3 have shape ''
Therefore 0 $ 6 gets reshaped to ''
Now step 2: 2. Bringing the arguments to a common rank (of at least 1)
by repeatedly /itemizing/ (,:)
<http://jsoftware.com/help/dictionary/d322.htm> any of lower rank
Now, both arguments are rank-1 arrays. One is 1 2 3 and the other is ''
Step 3 can be skipped. Our result is 1 2 3 APPEND '' which 1 2 3
Now, for the one that confuses me 1 2 3 , 6
Step 1 is 1. Reshaping an atomic argument to the shape of the items of
the other
In my opinion 6 is atomic and 1 2 3 is not, so we must shape 6 to the
ITEMS of 1 2 3
So an item of 1 2 3 has shape '' so the 67 becomes '' and the result
should end up the same as the last one.
Now, again, intuitively appending a 6 to 1 2 3 should (and does) yield 1
2 3 6 but when I try to follow the dictionary, I have to ask: how is my
thinking about step 1 incorrect?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm