for vectors, this is ok 7 (([ $~ >.&# ) ; ] $~ >.&#) i.5 ┌─────────┬─────────┐ │7 7 7 7 7│0 1 2 3 4│ └─────────┴─────────┘
I thought this should work too though. 7 ;&($~ >.&#) i.5 ┌─┬─────────┐ │7│0 1 2 3 4│ └─┴─────────┘ Is there a way to chain & to get first result? On another note, if you imagine a language that doesn't have a rank conjunction, or shape compatibility concepts, you would have to reshape for them. 7 6 + i.2 5 7 8 9 10 11 11 12 13 14 15 2 5 $ 5 # 7 6 7 7 7 7 7 6 6 6 6 6 can you make an adverb that reshapes the right argument such that a rank0 verb would produce a sensible result, or more impressive, reshape both arguments if they are incompatible to reproduce "0 1 behaviour? ie. 7 6 +/ i.5 7 8 9 10 11 6 7 8 9 10 which is (2 5 $ 5 # 7 6 ) + 2 # ,: i.5 7 8 9 10 11 6 7 8 9 10 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
