I want the first result below to be (shape) 3 2 6, not 1 3 2 6 .
I am surprised because the last result below shows that the leaf I desire
has the desired shape, 3 2 6.
Short of using Takes instead of the Head, I would like to produce the
desired result by only messing with the middle tine in the fork. That is,
in `b ([ (xxx) }.@])d`, I want only the xxx=:>@{.@>@] )}.@] altered.
Can you explain or remedy the problem?
(NB. line wrap problem below)
$b([(>@{.@>@] )}.@]) d
1 3 2 6
d
┌─────────────┬─────────────────────────────┐
│┌─────┬─────┐│┌──────────────────┬────────┐│
││10 8│10 10│││ 7 _8 _4 _8 1 1│10 10 10││
││ 1 _7│ │││_8 1 8 _10 _7 _2│ ││
││ │ │││ │ ││
││ 2 _7│ │││ 5 _5 3 2 1 2│ ││
││_1 10│ │││_7 _4 _1 _2 _2 _1│ ││
│└─────┴─────┘││ │ ││
│ ││_9 _8 8 9 3 _5│ ││
│ ││_4 _2 7 7 5 _2│ ││
│ │└──────────────────┴────────┘│
└─────────────┴─────────────────────────────┘
5!:5<'d'
(<(2 2 2$10 8 1 _7 2 _7 _1 10);10 10),<(3 2 6$7 _8 _4 _8 1 1 _8 1 8 _10 _7
_2 5 _5 3 2 1 2 _7 _4 _1 _2 _2 _1 _9 _8 8 9 3 _5 _4 _2 7 7 5 _2);10 10 10
$L: 0 d
┌─────────┬─────────┐
│┌─────┬─┐│┌─────┬─┐│
││2 2 2│2│││3 2 6│3││
│└─────┴─┘│└─────┴─┘│
└─────────┴─────────┘
--
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm