I'll just add, for the adverbs that return verbs, and / is a good example. The monadic case of u/ uses a dyadic u to insert u into arguments of the "resulting verb" u/ For dyadic/table case of / it is [x] u/ y, the presence of x that applies the dyadic case to the u/ resulting verb. It is noteworthy that perhaps the bivalent / should not have been implemented this way. dyadic / is equivalent to u"_1 _. Perhaps dyadic / could have been implemented as ]F.: all along. The guide to parsing adverbs is that an adverb only looks at its main/only argument in order to return something. If that something is a verb, then it is bivalent and needs to react to both calling conventions. In an explicit (or just using : in tacit) adverb definition, you have the option to define both valences independently. On Saturday, June 10, 2023 at 05:40:20 p.m. EDT, Raul Miller <rauldmil...@gmail.com> wrote: Adverbs are never dyadic. Nor are they monadic in the sense that verbs are monadic. (An adverb takes a single left argument, a monadic verb takes a single right argument.)
If the result of the adverb is a verb (which is the case for built-in adverbs, and many user defined adverbs), the resulting verb will carry up to two definitions -- a monadic definition and a dyadic definition. Which definition gets used depends on how that verb is used. If the verb is used in a context where it doesn't have a definition, you get an error. I hope this makes sense, -- Raul On Sat, Jun 10, 2023 at 5:36 PM Raoul Schorer <raoul.scho...@gmail.com> wrote: > > Hello, > > When an adverb is executed, it should follow line 3 of the parsing table ( > https://www.jsoftware.com/help/jforc/parsing_and_execution_ii.htm ). But: > > > - How does the interpreter know if it should execute the 'monadic' vs. > 'dyadic' adverb, e.g. 'infix' or 'table' in the case of '/' ? > - And how does the interpreter infer the definite resulting > part-of-speech? Is there a check testing whether the result of the adverb > application is a procedure, and if so its arity? > > > The documentation states that "In all cases the word replacing the fragment > has a definite part of speech, and if it is a verb, a definite rank". How > this is achieved for all cases with an adverb is non-obvious to me... > > Thanks! > Raoul > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm