You can't save it using &. . But nothing stops you from writing your own conjunction.

semidual =: 2 : 0
:
u&.(x&v) y
)

Henry Rich

On 1/1/2017 3:40 PM, David Koppenhoefer wrote:
Reading the wonderful NuVoc I found the gem that dyadic # has an inverse
- it can therefore be used in &. like

    >: &. (0 0 1 0 0 1&#) i.6
0 0 3 0 0 6

, executing a function only on selected items of an array while keeping
the shape.

The bit array is a noun, but I want to compute it on the fly (from the
right argument).  If the v in u&.v had dyadic valence, something like

    0 0 1 0 0 1  >:@] &. #  i.6

would be possible and the left argument could be replaced by a
computation. Here I'm stuck. From what I understood so far this seems to
be impossible - the v in the &-conjunctions is always monadic. Is
there a way to save the idea?


P.S.: needed in AoC day 24...
----------------------------------------------------------------------
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