a=:1 2 3; 4 5 6; 7 8 9
b=:(1 + i. 3 3);(4 + i. 3 3);(7 + i. 3 3)
NB. take first and last of each ordered list, return min & max of all
mnxbox=:(<./,>./)@:(,)@:(({.,{:)@:>)
mnxbox a
1 9
NB. but when a boxed list of tables, only apply to first row in each
NB. is there a simple way to filter by this second request?
NB. use if you want your code to fragment version:
mnxbox2=:(<./,>./)@:(,)@:(({.@:{.,{:@:{.)@:>)
mnxbox2 b
1 9
NB. alternatively, could have two versions of the verb,
NB. or define an n-line verb with if.
NB. perhaps the request should have been titled conditional selection
NB. from nouns of different rank. I see it as a filter though.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm