You have already found the correct forks (>. - <.) and ([: | -).

I just wanted to point out that your example below works, but you have
called the monadic case.

For:
     PosDiff =: (] >. [) - (] <. [)
Try:
     4 PosDiff 3
     3 PosDiff 4

.../Rob

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Terrence Brannon
Sent: Sunday, 6 May 2007 11:12 PM
To: General forum
Subject: [Jgeneral] PosDiff =: (] >. [) - ([ <. ]) NB. this is not a fork?


Here is the definition of positive difference that works:

PosDiff =: 4 : '(x >. y) - (x <. y)'

I tried to create a version which is a fork, but it is returning 0 0 instead
of differencing them:

PosDiff =: (] >. [) - (] <. [)
   PosDiff 4 3
0 0
   PosDiff 3 4
0 0
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


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

Reply via email to