I think that this is should be equivalent to the while version. Except that as
pointed out by Henry Rich some years ago, the execution sequence of a for_x loop
is undefined in the dictionary, so that the items of the resulting r may not be
in the correct order. If paranoid, think twice before using a for_x loop.
Terrence Brannon wrote:
RE: http://www.jsoftware.com/help/primer/basic_list_adding.htm
I think it would be nice to poke people's memory with a for_item. based example
instead of just using while.
Here's the naive version, done with for
addlis =: 4 : 0
r =. ''
for_i. x
do.
r =. r , (i_index { x) + (i_index { y)
end.
r
)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
--
regards,
bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm