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