That is the same as:
4 : 0
la =. x >. y
sm =. x <. y
la - sm
)
We can substitute the intermediate variables:
4 : 0
(x >. y) - (x <. y)
)
And collapse onto one line: 4 : '(x >. y) - (x <. y)'
Worth noting is that we can write this as a fork: >. - <.
-E
On Fri, 24 Sep 2021, R.E. Boss wrote:
From Learning J
PosDiff =: 4 : ('la =. x >. y' ; 'sm =. x <. y' ; 'la - sm')
How do I transfer this in a single line direct definition?
R.E. Boss
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm