[Jprogramming] clarification on parsing adverbs and conjunctions.

Pascal Jasmin godspiral2000 at yahoo.ca
Wed Oct 18 03:25:48 HKT 2006


(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 f at g@h/\ data 
is equivalent with the verb phrase in parens,
verbornoun (f at g@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:
f at g 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










More information about the Programming mailing list