John

   3 : 0 (or indeed monad : 0) defines a monad by default,
but may be used to create both; try for example

annmatch=: 3 : 0 NB. this default monad call assumes existence a global bals bals annmatch y : NB. this the start of the dyadic section NB. next line uses the x input/argument
bals =. x
countmatches=: a: NB. you could keep this local by the alternative NB. countmatches=. a: NB. ... unless you need the array after return
NB. rest as before
)

Alternatively, you can create the dyad with 4 : 0 (or dyad : 0) as follows:
annmatch=: 4 : 0
NB. don't include the single colon ":"

NB. next line uses the x input/argument
bals =. x
NB. the rest as before
)

I expect you'll get many other helpful replies once they wake up stateside (and elsewhere!)

Mike


Saunders, John (HEALTH) 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.

Any direction would be appreciated annmatch=: 3 : 0 countmatches=: a:
for_a.
  y
do. countmatches=: countmatches,(<( {: /:>(+/ each a e. each bals)))
end.
}.countmatches
)

thanks
John


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Thursday, 28 August 2008 1:30 PM
To: [email protected]
Subject: Programming Digest, Vol 35, Issue 59

Send Programming mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.jsoftware.com/cgi-bin/mailman/listinfo/programming
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Programming digest..."
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

No virus found in this incoming message.
Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 270.6.9/1637 - Release Date: 27/08/2008 07:01



No virus found in this incoming message.
Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 270.6.9/1637 - Release Date: 27/08/2008 07:01




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

Reply via email to