Thanks to all the informative responses. I knew there had to be a way to use \ for the sliding window, but it didn't occur to me to use ] to access the right argument.
so ]\1 2 3 1 0 0 1 2 0 1 2 3 but 1 2 3\1 2 3 |domain error | 1 2 3 \1 2 3 I thought that ] replicated the right argument, but appaently not. Why does the first example work, and the second doesn't? What exactly is the ] doing in the first example? Skip Skip Cave Cave Consulting LLC On Mon, Feb 19, 2018 at 1:09 PM, Skip Cave <[email protected]> wrote: > How can one create a sliding window in J? > > 3 sw i.6 > > 0 1 2 > 1 2 3 > 2 3 4 > 3 4 5 > > 4 sw i.7 > 0 1 2 3 > 1 2 3 4 > 2 3 4 5 > 3 4 5 6 > 4 5 6 7 > > What is the J code for sw? > > > > > > Skip Cave > Cave Consulting LLC > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
