Thanks for all of the responses and pointers. My example is purposefully "bad" in a loop wise sense because the problem I am solving does not know the shape of the items before the loop starts, although all of the items do share a common (unknown before the loop) shape. That is why I initialise using output =. '' and end up having to drop the first item.
thanks, Matthew. 2009/11/10 Sherlock, Ric <[email protected]> > > From: Devon McCormick > > > > I don't know how simplified your example is compared to your real > > problem, > > but any loop in J makes me suspicious. > > > > Your example, as stated, could be done without looping like this: > > > > example=: 3 : '>y$<i.2 3' > > $example 3 > > 3 2 3 > > > > I've tried to unlearn a tendency I had earlier to box things when it is not > necessary. > I would now prefer: > example=: 3 : 'y # ,: i.2 3' > > or tacitly: > example=: (# ,:)&(i.2 3) > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
