Tracy Harms wrote:
> By the way, what I'd expected to find
> as I went into this was a way to specify corner-plus-extent to },
> along the lines of (;.&0).
Well, } doesn't support corner-plus-extent natively, but as you point out,
;.0 does, so we can leverage that.
NB. Indicies of corner-plus-extent
icpe =: ];.0(<@#:i.)@:$
] D=: 7 5 [EMAIL PROTECTED] 10
6 5 9 2 4
9 0 7 0 4
6 8 3 8 1
2 8 0 0 2
1 6 0 4 4
1 3 3 6 6
5 7 8 8 2
(3 2 ,: 2 2) icpe D
+---+---+
|3 2|3 3|
+---+---+
|4 2|4 3|
+---+---+
D {~ (3 2 ,: 2 2) icpe D
0 0
0 4
(2 2 $ _ _) ((3 2 ,: 2 2) icpe D) } D
6 5 9 2 4
9 0 7 0 4
6 8 3 8 1
2 8 _ _ 2
1 6 _ _ 4
1 3 3 6 6
5 7 8 8 2
(3 2 ,: 2 2) (_ $~ {:@:[)"_`icpe`] } D
6 5 9 2 4
9 0 7 0 4
6 8 3 8 1
2 8 _ _ 2
1 6 _ _ 4
1 3 3 6 6
5 7 8 8 2
-Dan
PS: By the way, you only need & to bind nouns to verbs. Since ;. is a
conjunction, it will "automatically" bind to an argument (even if the other
argument is missing). So what you mean by ;.&0 you actually say with ;.0 .
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm