Sorry I've been a bit offline lately. I've been preoccupied with a possible change of job, but I've got your suggestions in the queue and I'll be back on the planet in a little while.
Adrian. On 29 March 2011 19:16, Raul Miller <[email protected]> wrote: > On Mon, Mar 28, 2011 at 5:01 AM, Adrian May > <[email protected]> wrote: > > In principle, I want to build a list recursively using some function to > > generate each element from the previous one, up to a certain length. I > tried > > it with /\ but just got strange results: > > > > (2*[)/\ 2 3 4 > > 2 4 4 > > It occurred to me finally, what you were expecting here. > > The issue I think you are describing is > / computes results from right to left > \ accumulates results from left to right > > The simple approach to accumulating results in the same order that > they are computed would be to use \. > (2*])/\. 4 3 2 > 8 4 2 > > A more complicated approach would be to do the double reverse cross thing: > (2*[)~/\.&.|. 2 3 4 > 2 4 8 > > -- > Raul > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
