[Jprogramming] argument for under
Ric Sherlock
tikkanz at gmail.com
Tue May 30 11:45:21 UTC 2017
Hi Brian,
Not sure if I've understood exactly what you're trying to accomplish, but
the following seems to give the same result as above and enables the 1 to
be an argument
1 ([: ;/ |.) i.5 4 3
HTH
Ric
On Tue, May 30, 2017 at 11:00 PM, Brian Schott <schott.brian at gmail.com>
wrote:
> The following expression accomplishes my goal when the array on the right
> (i. 5 4 3 here) needs to be rotated by 1, the leftmost 1. But I want that 1
> to be an argument, also.
>
> ;/(1|."_1]) &. (1 0 2&|:)i.5 4 3
>
> But my attempts such as the following, produce errors.
> Can you suggest a solution, preferably tacit?
>
> ;/1(([|."_1]) &. (1 0 2|:]))i.5 4 3
> |index error
> | ;/1 (([|."_1])&.(1 0 2|:]))i.5 4 3
>
> Thanks,
>
>
> --
> (B=)
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list