I'm wondering what a good way to approach this is. I am aware of the
technique of tying gerunds and then choosing one with @.

I am also aware of verb~ to flip the arguments to verb.

Here is what I need to do. Given this function:

 eval_A_times_u =: 3 : 0
r    =. ''
for_i. y do.
 sum =. 0
 for_j. y do.
   sum =. sum + ( (i_index eval_A j_index) * j )
 end.
 r =. r , sum
end.
r
)

I need a version just like this with only one change:
   sum =. sum + ( (i_index eval_A j_index) * j )
needs to be
sum =. sum + ( (i_index eval_A~ j_index) * j )

Note the tilde after eval_A.

Now I could copy and paste the whole thing and put the ~ in, but I
know there must be an elegant way to synthesize both of these
functions from a common core template.

If you have suggestions on getting rid of my for loops like John
suggested, I'm all ears for that too.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to