http://www.jsoftware.com/help/dictionary/dicapdot.htm says
"If y has the shape of an item of x , then x I. y is the least non-negative
j such that j{x follows y in the ordering, or #x if y follows {:x in the
ordering or if x has no items"
Now I want a verb foo such that
"If y has the shape of an item of x , then x foo y is the greatest
non-negative j such that j{x is followed by y in the ordering, or _1 if y is
followed by {.x in the ordering or if x has no items"
(The _1 may be any number outside i. # x )
Any (elegant or efficient) suggestions?
I came up with
foo=: |[EMAIL PROTECTED] (1-~ [EMAIL PROTECTED] - I.) ]
0 2 2 5 foo _5 1 2 3 9 0
_1 0 2 2 3 0
R.E. Boss
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm