> The problem: is there any way (i.e tacit/implicit) to model the dyadic
> case of the expected [email protected] ?
There is a way to model the entire desired behavior of agenda, for both
derived monads and derived dyads. To wit:
agenda =: conjunction define
if. verb = nc{.;:'v' do.
m...@.( v y) y
else.
[email protected]
end.
:
if. verb = nc{.;:'v' do.
x m...@.(x v y) y
else.
[email protected]
end.
)
or, perhaps with more fidelity,
agenda2 =: conjunction define
if. verb = nc{.;:'v' do.
fp =. adverb def ' ''('' , '')'' ,~ 5!:6{.;: ''u'' 'NB.
Fully
parenthesize
txtV =. v fp NB.
Selection verb
as text
txtM =. m fp NB.
Gerund as text
txtMonad =. ' ', txtM , '@.( ', txtV ,' y) y ' NB.
Monad as text
txtDyad =. ' x ', txtM , '@.(x ', txtV ,' y) y ' NB.
Dyad as text
3 : ( txtMonad ; ':' ; txtDyad )
else.
[email protected]
end.
)
.
Of course, this is explicit, and you asked for tacit/implicit. Now, in old
versions of J there were specific, supported rules for deriving a
conjunction tacitly. Those rules were removed in J5. However, I recently
(relativly speaking) discovered that there might be a different path to
this goal (defining tacit conjunctions). But I'm still not certain of it.
What I am certain of, is that it's possible to tacitly define adverb,
which, given an argument, itself derives another adverb, which, given an
argument derives the "end target" (be that a verb, noun, or even another
adverb, ad infinitum). This allows us to tacitly define an adverb that is
functionally equivalent to a conjunction; it takes two arguments to
produce a verb (or whatever), which operates as usual.
Of course, with this type of entity, both arguments to the "conjunction"
would appear on the left (seriatim), as opposed to a true conjunction,
which has one argument on the left and another on the right. But
depending on your needs, that may be a minor syntactic issue.
I have some ideas of how we might use this pattern to define a tacit agenda
with the desired properties; but the fact that all 3 or 4 arguments
(gerund, selection verb, and argument(s) to the derived verb) are required
simultaneously might present a hurdle.
However, if you're interested, I could give you some pointers.
-DAn
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm