You have a bunch of different values for r, and the final value has
everything already “in place”.

So it’s not completely clear what problem you are trying to solve.

That said, my best guess would be that you are trying to achieve “use rank
conjunction on the adverb argument to amend.”

If so, that might look like:

r=: w 2 :’m y}n’”2 i Y

With Y’s items extracted from your various sentences...

(If that’s not where you were heading, could you state it differently?)

Thanks,

—
Raul

On Monday, February 18, 2019, Brian Schott <[email protected]> wrote:

> The snippet below produces a value for r which I would like to produce more
> elegantly: without the for. loop suggested by the repeated building of
> r-values. Perhaps a gerund-powered amend could work, but I am not
> optimistic enough to travel there without some encouragement.
>
> The result in r is attempting to move the array w to each of the 4 corners
> of the array i, in turn.
>
> *******snippet below*******
>
>    combis =: #:i. 4
>    w=: 2 2$'abcd'
>    i=: 3 3$'MNOPQR'
>    combis<"1@:{2<\i. 3
> ┌─────────┬─────────┬─────────┬─────────┐
> │┌───┬───┐│┌───┬───┐│┌───┬───┐│┌───┬───┐│
> ││0 1│0 1│││0 1│1 2│││1 2│0 1│││1 2│1 2││
> │└───┴───┘│└───┴───┘│└───┴───┘│└───┴───┘│
> └─────────┴─────────┴─────────┴─────────┘
>    ]r=:w (<0 1;0 1)}i
> abO
> cdR
> MNO
>    r=:r,:w (<0 1;1 2)}i
>    r=:r, w (<1 2;0 1)}i
>    ;/r=:r,w (<1 2;1 2)}i
> ┌───┬───┬───┬───┐
> │abO│Mab│MNO│MNO│
> │cdR│Pcd│abR│Pab│
> │MNO│MNO│cdO│Mcd│
> └───┴───┴───┴───┘
>
>
> Thanks,
>
> --
> (B=)
> ----------------------------------------------------------------------
> 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