; looks at all the contents and decides the shape of an item of the
result, and then brings each contentes up to that shape. ,&.>/ should do
the process starting at the end, which can produce a different result:
m =. (1 3$3);2;1 1
comma =. ,
comma&.>/ m
+-----+
|3 3 3|
|2 1 1|
+-----+
<@; m
+-----+
|3 3 3|
|2 2 2|
|1 1 0|
+-----+
The special code for ,&.>/ seems to use the code for <@;
,&.>/ m
+-----+
|3 3 3|
|2 2 2|
|1 1 0|
+-----+
Another point of difference is scalar replication for fill:
n =. (1 3$3);2;(1 2$1)
comma&.>/ n
+-----+
|3 3 3|
|2 2 0|
|1 1 0|
+-----+
<@; n
+-----+
|3 3 3|
|2 2 2|
|1 1 0|
+-----+
,&.>/ n
+-----+
|3 3 3|
|2 2 2|
|1 1 0|
+-----+
Henry Rich
On 11/13/2015 4:01 AM, robert therriault wrote:
Were you thinking of this?
<@;1 3$ ((1 2); (2 3); i. 4)
┌───────────────┐
│1 2 2 3 0 1 2 3│
└───────────────┘
,&.>/1 3$ ((1 2); (2 3); i. 4)
┌───┬───┬───────┐
│1 2│2 3│0 1 2 3│
└───┴───┴───────┘
or was your list of boxes dimension 1 (in which case I don't see a difference in results between
<@; and ,&.>/ although the process of getting the results may differ because ,&.>/
operates between each item and <@; works on the entire array at once.)
Cheers, bob
On Nov 12, 2015, at 5:04 PM, Henry Rich <[email protected]> wrote:
You're right again... but I was thinking about cases where y is a list of boxes.
Henry Rich
On 11/12/2015 6:19 PM, robert therriault wrote:
,&.>/ <"1 i. 2 3 2
┌───────┬───────┬─────────┐
│0 1 6 7│2 3 8 9│4 5 10 11│
└───────┴───────┴─────────┘
,&.:>/ <"1 i. 2 3 2
┌─────┐
│ 0 1│
│ 2 3│
│ 4 5│
│ 6 7│
│ 8 9│
│10 11│
└─────┘
<@; <"1 i. 2 3 2
┌─────────────────────────┐
│0 1 2 3 4 5 6 7 8 9 10 11│
└─────────────────────────┘
Cheers, bob
On Nov 12, 2015, at 3:07 PM, Henry Rich <[email protected]> wrote:
Your examples are right... but I was thinking about cases where y is boxed.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm