On Sat, Jun 6, 2009 at 10:12 AM, PackRat<[email protected]> wrote: > Thanks, Raul, Bill, and Fraser! However, after reading your responses, > I'm more in the dark now than before, concerning dyadic left and right! > ... > I am really trying to avoid what you term a "pre-mature shortcut" by > taking the DOJ's EXACT AND LITERAL wording in its normal English sense > without any special meanings or understandings associated with it which > aren't stated. As I stated in my original message: >> > Now here is where I need further enlightenment: ... >> > Taking the Dictionary definition exactly and literally, it would >> > appear that ... everything to the left of the "]" should be thrown >> > out and only the "]" and its rightward elements would be returned. > > And you (Bill Lam) wrote: >> Suppose a b c are verbs and you define a train f=: a [ b ] c > > As I said above, using the EXACT AND LITERAL wording of the DOJ meaning > of dyadic [ and ] in the standard English sense and applying it to what > I see in your train above, moving from right to left, the DOJ meaning > would be to view it as ( a[b ) ] (c) , where I've parenthesized what's > to the left and right of ] .
That isn't the way J is parsed. Bill's message goes on to show how this verb train would be interpreted dyadically, starting with x (a [ b ] c) y to make the first expansion of x f y In that example x and y are nouns, but f, a, b, c, [, and ] are all verbs. I think we should first consider what [ and ] would mean in a noun phrase, where n2 [ n1 ] n0 is an interleaving of two verbs amidst three nouns. Adding parentheses to illustrate how this would be parsed: (n2 [ (n1 ] n0)) The result of the inner (rightmost) dyadic verb is n0: (n2 [ n0) The result of that is n2. Does all of that seem clear? If we turn back to Bill's example we're looking instead at a verb phrase, or train. The meaning of verbs in trains is very different from their meaning when they occur in noun phrases. It's one of the trickier things about J, as has been discussed at some length recently in the Chat forum. I see that Raul has elaborated on trains while I've been composing this. The main documentation of trains is here: http://www.jsoftware.com/help/dictionary/dictf.htm In a noun phrase (to use Raul's term, which I like,) a dyadic verb is resolved to a value by taking the adjacent nouns as parameters. 3 ] 4 4 In a fork, the verbs that surround the central verb are not parameters to that verb. Their results will be parameters to the central verb, if the fork is resolved by providing noun parameters. ] ] ] NB. The result of this sentence is a verb comprised of three verbs "as a train" +-+-+-+ |]|]|]| +-+-+-+ 'x'(] ] ])'y' NB. a train resolved dyadically; the result is a noun. y What the DOJ does not explain in the entries for primaries are the rules by which verbs obtain their arguments. Once you understand how verbs get their arguments in different contexts, I think you'll see that the page for Same/Left, Right is accurate and simple. My impression is that most people struggle with this aspect of J; I know I have. As Raul noted, this is a difficulty regarding the grammar, not the definitions of particular primaries. Hang in there. I found a lot of satisfaction as it clarified for me. Tracy > Taking the DOJ definition at its exact > and literal meaning, that would mean the result is c , with a[b > being tossed out (ignored) in the process. In theory, if I gave the > DOJ definition and your (or any other) expression to someone who knew > nothing about the J language and asked them to "solve the puzzle" > (working from right to left, of course), what I just stated above would > be the result they (a typical person off the street = beginner) would > come up with. My point is that, if the truth of the matter is > different from this, then the definition is lacking some interpretive > information that really needs to be stated. If you have to tell me > more than "yields the left/right argument" as I interpreted it above > according to standard English meaning and grammar, then I think > something's missing from the definition. I may be completely all "wet" > here, but does this make it clearer where I'm coming from? Forum > members keep referring me (as a beginner) to the DOJ, and I do so--but > this DOJ definition just does not help me understand what's going on in > "real" J coding of "left" and "right" that people post here all the > time, leaving me wondering what their code really does and how it does > it. > > I'd still really like to see an essay explaining dyadic left and right > (and all of their uses) in verbose detail! (I think this is a really > important issue for beginners to the language, since so much seems to > depend upon it in J programming.) Thanks in advance for any further > guidance and assistance you all can give in helping me to understand > this whole thing! > > Harvey > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
