The documentation on Foreign Conjunctions includes "Apply" 128!:2 .
You may find this will do what you want.
Mike
On 28-Sep-07, at 2:34 PM, Martin Pelletier wrote:
Hello,
I'm trying to use agenda dyadically to apply monadic verbs. I will
admit this may not be the best solution to my problem. The concept
behind this would be equivalent in C to looping through each value
of "val" and to apply whichever "operator" at the same index with a
select.
Suppose I have the following verbs, which would be to be used
monadically:
v1 =: +:
v2 =: *:
NB. x is a string which identifies which operation to pick, either
double or square
operator =: 'dddssds'
val =: i. #operator
operator v1`v2 @. ('ds'& i. @:["0) val
This is the clumsy and erroneous "thing" I can come up with. I
can't progress further...
If there is something simpler, better, and/or susceptible to be
faster, I will gladly take suggestions.
Thanks!
Martin
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm