A follow up is that an adverb can apply what looks like a monadic verb phrase dyadically (~ is the main example)
2 + a1 \ 1 2 3 monad monad 2 + a1 ~ \ 1 2 3 dyad dyad 2 < \ 1 2 3 NB. just to explain why the verb phrases above return 2 results. +---+---+ |1 2|2 3| +---+---+ 2 + ~ \ 1 2 3 NB. ~ is reflex not passive 2 4 4 6 ----- Original Message ---- From: Pascal Jasmin <[EMAIL PROTECTED]> To: Programming forum <[email protected]> Sent: Tuesday, October 17, 2006 3:25:48 PM Subject: [Jprogramming] clarification on parsing adverbs and conjunctions. (Appologies if duplicate) Its easy to get confused as to whether long verb phrases are monads or dyads because specific explanations or coping techniques are missing in the docs. A verb phrase is the consecutive string of bondings to conjunctions and adverbs. For instance, verbornoun [EMAIL PROTECTED]@h/\ data is equivalent with the verb phrase in parens, verbornoun ([EMAIL PROTECTED]@h/\) data The underdocument fact I'm reporting in this post is that the monad or dyad status of the verb phrase is entirely determined by the right most adverb or conjunction. Conjuncitons and adverbs "deeper" (further left) into the verb phrase will only see a dyad application of the remaining verb phrase, only if 'rightmoster' modifiers let them (by applying the remaining verb phrase dyadically instead of monadically). (appreciate confirmation if there are no exceptions) For example, a1=: 1 : 0 if. u y do. 'monad' end. : if. u x do. 'dyad' end. ) + a1 1 monad 2 + a1 1 dyad 2 + a1 / 1 2 3 dyad 2 + a1 \ 1 2 3 monad monad The lesson to avoid confusion is to be aware of how specific adverbs and conjunctions permit the modifiers deeper into a verb phrase from viewing their world (having an extra basic (b.) or foreign function to extract that information from modifiers would be very helpful in syntax colorizing/formatting or debuging info... but could be too difficult) Some examples: [EMAIL PROTECTED] makes f monad --> f x g y f&g makes a custom train --> (g x) f g y which might at first confuse, but note that f is a dyad in the expansion, and so the entire 'remaining' verb phrase would be applied dyadically: x h&f&g y ---> (g x) (h&f) g y ---> (f g x) h f g y ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
