Thanks. That helps me getting over the mistake I made regarding .(dot) when I treated it as a verb instead of a conjunction. Now, I attempt to clarify the understanding I have. Do let me know if this is what was intended.
u . v is defined by u@(v"(1+lv,_)) , restated in English below. The definition u@(v"(1+lv,_)) given above for the dyadic case may be re-stated in words as follows: u is applied to the result of v on lists of "left argument cells" and the right argument *in toto*. The number of items in a list of left argument cells must agree with the number in the right argument. Thus, if v has ranks 2 3 and the shapes of x and y are 2 3 4 5 6 and 4 7 8 9 10 11, then there are 2 3 lists of left argument cells (each shaped 4 5 6); and if the shape of a result cell is sr, the overall shape is2 3,sr. So, putting this in context for mp(=. +/ . *)I have mp=. +/ . * ]A =: 2 3 $ 4 3 8 6 5 3 4 3 8 6 5 3 ]B =: 3 2 $ 5 4 9 6 4 2 5 4 9 6 4 2 u <=> +/ v <=> * Q1. What does the part "1+lv" mean? I assume lv means rank of * which the dictionary states is 0 0 0 . Q2. There is a third 0 in the rank definition of *. That is being ignored. Why? This gives me: A (*"(1,_))B I interpret *"(1,_) as "apply * to 1 cells of left argument to appropriate shaped cells of right argument". Verification: <" 1 A NB. Looks ok ┌───┬───┐ │4 3 8│6 5 3│ └───┴───┘ Q3. But how does J pick the column of B here as the cells to which to apply "*"? Can this be illustrated with appropriate J command to display the columns of B that would be consumed when * is applied? Moving on, I have A (*"(1,_))B 20 16 27 18 32 16 30 24 45 30 12 6 Now applying +/ atop the result is quite straight forward. Looks like there are some gaps in my understanding still (Q1, Q2, Q3 above). And the lv used in the dictionary is not clear. On 10/1/06, Roger Hui <[EMAIL PROTECTED]> wrote:
. (dot) is a conjunction. See its entry in the dictionary for the definition of u . v , and Appendix E of the dictionary for the part of speech of a symbol. Not all trigraphs are forks. For example, & is another conjunction and u&v is not a fork and x u&v y is not (x u y) & (x v y) . A fork is an isolated sequence u v w where u, v, and w are verbs. ----- Original Message ----- From: Yuvaraj Athur Raghuvir <[EMAIL PROTECTED]> Date: Sunday, October 1, 2006 6:25 am Subject: Re: [Jprogramming] J FAQ > Thanks! > > However, I donot fully understand why mp works, where, > mp =: +/ . * > > Assuming this is a fork, I should have > x mp y <=> x(+/ . *) y <=> (x +/ y) . (x * y) > > Applying this to A & B as in FAQ, I get > (A +/ B) . (A * B) > |length error > | (A+/B) .(A *B) > > Why? > > Or is mp treated as an atomic phrase? > > Some clues would help....my guess is that dot is the place where I > donotunderstand what is happening.... ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
