Terrence wrote: > In order to compare a noun with itself right-shifted 1 place, they > wrote the following: > test=.~:~1&|. > But [...] > test2=.~:1&|. > Leads to the same output.
Which is expected; ~: has to be commutative. Just as x=y can't differ from y=x , the dyads ~: and ~:~ can never produce different results. > Why do you think the authors used ~ to flip the > arguments to ~: Probably to get you used to the pattern (f~ g) . As we discussed, it is fairly common in J, and some expressions using it are idiomatic, such as (#~ filter) , (</.~ categorization) and (<;.1~ partition) . I bet Linda and Norman forced you go through the analysis you did to lessen any suprise or confusion upon encountering one of these. -Dan PS: A note on nomenclature: Formally, only verbs can be qualified with "monadic" or "dyadic". So there is no "dyadic ~". Informally, saying "dyadic ~" is fine, but technically it is its verb argument which is (invoked) dyadic(ally). To be precise, you could say "commute" instead of "dyadic ~" and "reflex" instead of "monadic ~". Other synonyms for "commute" are "passive" and "cross". ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
