Raul,
Having finally looked at the details, I am most impressed now with
your solution. I was puzzled for a while as to why you had defined
trap to be an adverb instead of a verb, but I see now that by doing so
you were able to make the final line a tacit verb. Very kewl. Thank
you.
I may revert your trap to a verb so that I can merge multiple left
arguments with ,: instead of ,. , though, because that fits my
existing case more.
The verbized version of your trap looks the following, for now.
trapv=: (4 :0)
'a b c d'=. x
s=. _1 1 * % _2 -/\ x
z=. - 0 3 { x
((b&(<:/) *. c&(>:/)) >. [: <./ 1 <. 0 >. s * z +/ ])y
)
--
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm