I want to put the operation which takes all the items in a list which are greater than 2 into a pointless (as in not explicitly capturing the argument in a variable) function in J. I wanted to do this by using ~
with a hook, like f =: ((> & 2) #)~
but it seems like neither that nor ((> & 2) #~)
works.
My reasoning was that my function has the form (f y) g y
where y
is the list, f
is (> & 2)
, and g
is #
. I would appreciate any help!
#~
appear at the left of a hook are "copy where." In this case, "copy where greater than two." – Mazman