>>  <<  Ndx  Usr  Pri  Phr  Dic  Rel  Voc  !:  wd  Help  Dictionary

Item Amend m}  _ _ _ Amend

If m is numeric and z=: m} y, then $z equals $m, which equals the shape of an item of y . The atom j{z is j{(j{m){y . For example:
   y=: a.{~(a.i.'A')+i.4 5
   m=: 3 1 0 2 1
   y ; m ; m}y
+-----+---------+-----+
|ABCDE|3 1 0 2 1|PGCNJ|
|FGHIJ|         |     |
|KLMNO|         |     |
|PQRST|         |     |
+-----+---------+-----+
  If m is not a gerund, x m} y is formed by replacing by x those parts of y selected by m&{ . Thus:
   y; '%*'(1 3;2 _1)} y
+-----+-----+
|ABCDE|ABCDE|
|FGHIJ|FGH%J|
|KLMNO|KLMN*|
|PQRST|PQRST|
+-----+-----+
$x must be a suffix of $m{y , and x has the same effect as ($m{y)$,x . Thus:
   y; 'think' 1 2} y
+-----+-----+
|ABCDE|ABCDE|
|FGHIJ|think|
|KLMNO|think|
|PQRST|PQRST|
+-----+-----+

If m is a gerund, one of its elements determines the index argument to the adverb } , and the others modify the arguments x and y :
x (v0`v1`v2)} y   «   (x v0 y) (x v1 y)} (x v2 y)
(v0`v1`v2)} y « (v1 y)} (v2 y)
(v1`v2)} y « (v1 y)} (v2 y)

For example, the following functions E1, E2, and E3 interchange two rows of a matrix, multiply a row by a constant, and add a multiple of one row to another:
   E1=: <@] C. [  [.  E2=: f`g`[}  [.  E3=: F`g`[}
   f=: {:@] * {.@] { [
   F=: [: +/ (1:,{:@]) * (}:@] { [)
   g=: {.@]
   M=: i. 4 5
   M;(M E1 1 3);(M E2 1 10);(M E3 1 3 10)
+--------------+--------------+--------------+-------------------+
| 0  1  2  3  4| 0  1  2  3  4| 0  1  2  3  4|  0   1   2   3   4|
| 5  6  7  8  9|15 16 17 18 19|50 60 70 80 90|155 166 177 188 199|
|10 11 12 13 14|10 11 12 13 14|10 11 12 13 14| 10  11  12  13  14|
|15 16 17 18 19| 5  6  7  8  9|15 16 17 18 19| 15  16  17  18  19|
+--------------+--------------+--------------+-------------------+



>>  <<  Ndx  Usr  Pri  Phr  Dic  Rel  Voc  !:  wd  Help  Dictionary