Hi Raul,
I was not asking for an answer to the question, I already knew the
answer. I was noting that this was the question that I had asked myself.
I did not seek an answer in terms of the rules of tacit J. I knew the
rules and why these rules lead to this result. I was asking myself why the
rules of J are as they are and produce such a result. I figured out why
eventually and posted it on 22nd April.
I also explained the answer to my question again in a previous email:
"When moving the fork to tacit form, we need to remove the "y"s,
so that the fork consists of verbs. If the structure had
remained as it was, the fork in tacit programming
would have been: (M1)DM2 . The right to left rule would have
remained. The dyadic verb would still be identified by a right parenthesis
on its left. On execution, the right argument would be placed where
each of the "y"s had been.
However, for some benefit, which must have been good - but no one has
brought it up yet - the fork was changed to (M1DM2), which does not follow
the right to left rule. Supposing we have a stream of verbs in parenthesis,
say (%:+/+#^+:-), how do we know which is monadic and which is dyadic? There
is no noun or parentheses in the stream to help. We know that the first
three on the right are a fork, but what next? If it stops at 4, such as
(#^+:-), we know that the fourth is dyadic, because it becomes a hook.
In fact, the sequence is defined as alternating (DMDM) and that continues
indefinitely (MDMDMDMDMDM). Thus J tells whether a verb is monadic or
dyadic by its position in the stream. From the right, the odd numbered
positions are monadic and the even numbered positions dyadic.
Now the problem comes when we want to insert extra monadic verbs, say:
(MMDMDMMDM). The alternating sequence rule would get it wrong, So we
have to insert something between the first two "M"s from the right to say:
"The verb to my left is monadic, not dyadic": (MMDMDM@:MDM) Then
because the last verb will be assumed to be dyadic, we need a cap to
say: "This verb to my right is monadic, not dyadic". ([:MMDMDM@:MDM)
Don
----- Original Message -----
From: "Raul Miller" <[email protected]>
To: "Chat forum" <[email protected]>
Sent: Sunday, April 26, 2009 9:01 PM
Subject: Re: [Jchat] Language S
On Sun, Apr 26, 2009 at 3:27 PM, Don Watson <[email protected]> wrote:
> Why can I write:
>
> %:<.-:# y
>
> but have to change it when I want to store a verb that does the same thing
> to:
>
> answer =: %:@:<.@:-:@:#
>
> answer y
Your first example was a noun phrase, and your second example was
a verb phrase and you have asked why their grammar is different?
I think I can answer this question but I would first like to be sure that
I would be answering the right question for you.
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm