Yes, I apologize.

(I blame a mix of gmail's mangling of boxed display and my own lack of time
yesterday.)

And, since the problem is solved, I have nothing further to contribute.

Thanks,

-- 
Raul

On Thu, Nov 24, 2011 at 10:49 PM, Dan Bron <[email protected]> wrote:

> Raul Miller wrote:
> >     foo=: <^:{./.~ [: +/\ 0,2 ~:/\ ]
>
> REB asked for a foo such that:
>
>           foo 1 1 2 2 3 3 4 2 3 4 4 1 2 2 2 1
>        +---+---------------------------+-+-------+-+
>        |1 1|+---+---------+-+---------+|1|+-----+|1|
>        |   ||2 2|+---+---+|2|+-+-----+|| ||2 2 2|| |
>        |   ||   ||3 3|+-+|| ||3|+---+||| |+-----+| |
>        |   ||   ||   ||4||| || ||4 4|||| |       | |
>        |   ||   ||   |+-+|| || |+---+||| |       | |
>        |   ||   |+---+---+| |+-+-----+|| |       | |
>        |   |+---+---------+-+---------+| |       | |
>        +---+---------------------------+-+-------+-+
>
> Your foo gives:
>
>           foo 1 1 2 2 3 3 4 2 3 4 4 1 2 2 2 1
>         +---+-----+-------+-------+---+-----+---------+-+-------+-+
>        |1 1|+---+|+-----+|+-----+|+-+|+---+|+-------+|1|+-----+|1|
>        |   ||2 2|||+---+|||+---+|||2|||+-+|||+-----+|| ||2 2 2|| |
>        |   |+---+|||3 3|||||+-+|||+-+|||3|||||+---+||| |+-----+| |
>        |   |     ||+---+|||||4||||   ||+-+|||||4 4|||| |       | |
>        |   |     |+-----+|||+-+|||   |+---+|||+---+||| |       | |
>        |   |     |       ||+---+||   |     ||+-----+|| |       | |
>        |   |     |       |+-----+|   |     |+-------+| |       | |
>        +---+-----+-------+-------+---+-----+---------+-+-------+-+
>
> That is, you have the depth of each element right, but you still need to
> group the elements appropriately.  It helps to think of 1 1 2 2 3 3 4 2 3 4
> 4 1 2 2 2 1 as representing a parenthesized expression, with greater
> numbers
> being more deeply nested.
>
> -Dan
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to