---Saunders, John wrote:
>
> Hi guys I have the below verb annmatch and would like to make it a dyad
> the noun bals is what I want to replace with an X value so I can make
> this more flexible and not tied to bals ; just not exactly sure how to
> go about it ; hope I'm making sense and using the appropriate j-
> language
> here.

In addition to the helpful advice already given, you might find the following 
wiki page useful:
<http://www.jsoftware.com/jwiki/Guides/Defining_Verbs>

Note also (the following is a transcript from a J session)
   dyad    NB. this pre-defined when your session starts
4
   define  NB. so is this
 :0

NB. Therefore:
MyDyadicVerb=: dyad define
  x + y
)

Is equivalent to:
MyDyadicVerb=: 4 :0
  x + y
)

NB. Similarly:
MyMonadicVerb =: monad define
  2 * y
)

NB. is equivalent to:
MyMonadicVerb =: 3 :0
  2 * y
)

NB. It is less confusing to use "verb" instead of "monad" when
NB. defining a verb with both monadic and dyadic cases, although
NB. they are both just covers for 3:
  3 = monad , verb
1 1

MyVerb =: verb define
 2 * y
 :
 x + y
)

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to