To ignore the left operand of a dyad, use @] as in
([EMAIL PROTECTED])`([EMAIL PROTECTED]) @. ('ds'& i. @:["0)
Henry Rich
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Martin Pelletier
> Sent: Friday, September 28, 2007 5:35 PM
> To: Programming forum
> Subject: [Jprogramming] Dyadic use of agenda for monadic verbs
>
> 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