"PackRat" on Saturday, June 06, 2009 3:58 PM wrote: > I understand much of what you wrote, but I'm having the darndest time > understanding the DYADIC use of "[" and "]"--which is my long-standing > question in mind that I mentioned at the start of this message. > > The very lengthy recent discussion in JChat concerning Don Watson's > desires for what he considered simplification of J's syntax gave me a > moment of enlightenment about [ and ] . (On the other hand, maybe you > all might consider it a moment of *mis*-enlightenment!) And that "aha" > moment was that "[" referred to the noun in the left "x position" with > reference to the entire tacit verb expression and that "]" referred to > the noun in the right "y position" with reference to the entire verb > expression--in other words, in "x tacitverbexpression y", any "[" > within the tacit verb expression refers to the value of x and any "]" > within the tacit verb expression refers to the value of y. I don't > know if this understanding is correct, though.
> Now here is where I need further enlightenment: if what I just said is > true, then the Dictionary definition of "[" and "]" (left and right) > seems to be wrong as it stands. (This ties in as well with Raul's t1 > and t2 definitions above.) The important thing is to recognize that [ and ] are just verbs. In a train they behave exactly as any other verb as pointed out by Bill. In some positions they may as in his example mean some segment of the train is never returned. That can be useful if the verbs have some side effects though this is something generally discouraged by the functional programming community. Where they are used in a parenthesized component of a train, they may also refer to the results of other verbs in the train. 3( * ( * + [ ) + ) 2 36 You might also note that ( [ + [ ) 2 returns 4. Both these verbs have a meaning in a monadic context. You cannot in general substitute an x and a y for [ and ] because if the train has a monadic meaning and is used in a monadic context they will both refer to y. > However, in this case, I also posit the suggestion > that the Dictionary definition for left and right is TOO terse, leading > to possible errors of understanding because the definition contains > neither guidance for nor constraints on what the words "yields", > "left/right argument", and "x/y" mean or refer to in both explicit and > tacit usage. It currently seems that, if it's correct for explicit > verbs, then it's wrong for tacit verbs; likewise, if it's correct for > tacit verbs, then it's wrong for explicit verbs. This can't be right, > so it's currently a paradox for me. I think you would find it helpful to think of them as verbs which return one of x or y in a dyadic context, or the unchanged argument when used in a monadic context. That stresses the context within which they are used as in Bill's examples and those above. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
