On Tue, May 19, 2009 at 10:20 AM, Don Watson <[email protected]> wrote: > You state: > > "Also, consider something like: > ()+/%#(1 2 3)^2 > > Here, we have a monadic tacit verb. But we have an inside > out parenthesis on its left indicating it gets its left argument > from its left side. But it has no left argument. How would > I explain this to a student asking me about why he has to > use inside out parenthesis?" > > I don't understand why you would want to use the inside/outside > parentheses here. This is not a situation in which it provides any help. > You have no need for it.
I was working with a simple example to save me the effort of constructing a more complex example. That said, I currently believe I do not need inside-out parenthesis -- does this mean I should not be asking about how you intended them to work? > Who says it has to have a left argument? No one said that. However, your motivational statement suggested there could be one. I know you provided an explicit exception but that exception would be one more thing to learn. > If I could remove the left inside/out parenthesis, I would. > I only include it because there is a need to balance > parentheses, but only a "[" forces a left argument to be > sought. I think I understand this (though I disagree with a part of your statement). First, if I do provide a left argument, that just makes the problem worse. My (3+4*5)%,-(1 2 3)^2 sentence was an attempt to illustrate this conflict. Second, in J, forks (and all verbs regardless of whether or not they were verb phrases), left arguments are sought without the use of [. For example: 2 (+ % ]) 3 1.66667 Here, the addition operation uses both a left argument (2) and a right argument (3) and adds them together to get 5. The result is divided by the right argument (3). Or, if you prefer: 2 (+ % ]) 3x 5r3 Finally, in J, [ functions just fine without a left argument. [ 3 3 [\ 1 2 3 1 0 0 1 2 0 1 2 3 In monadic cases, [ is just the identity function. Only in dyadic cases does its "left identity" definition come into play. The beauty of [ and ] is that they are verbs, and their grammar matches the grammar of all other verbs. Their usefulness, as verbs, is rather analogous to the usefulness of zero in the context of numbers -- they can occupy a place in a structure which lets you see that structure without having to make up special rules to deal with the trivial cases. Then again, hypothetically speaking, the language did not actually need to provide [ and ]. We could instead be using 4 :'x' in place of [ and we could be using 4 :'y' in place of ]. However, this would not be very concise and if [ and ] were not present, this would encourage people to use awkward and perhaps inefficient circumlocutions, to make up for their absence. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
