Thanks for all the responses and in particular the suggestions of Jose M.Q. I studied the latter and sort of got the gist of it -- very useful.
I had hoped (in vain it looks like) for something direct as it seems a natural to would want to iterate over verbs with an adverb. Maybe conjunctions can deliver a direct approach. Have yet to look into it. Thanks again. I learn something new everyday. J is fantastic. On Fri, Aug 17, 2018 at 1:21 PM, 'Pascal Jasmin' via Programming < programm...@jsoftware.com> wrote: > Thank you Jose, > Would you by any chance have figured out a way to make AR tacit? > *: AR is so much easier to "call"/type than ar '*:' > (`'') almost works, though "fails" with nouns, but is useful for an > argument that can be verb or gerund. > On Thursday, August 16, 2018, 7:48:47 p.m. EDT, Jose Mario Quintana < > jose.mario.quint...@gmail.com> wrote: > > One the one hand, I find your adverb neat and clever. On the other hand, > I > like them beautiful and powerful. ;) > > Powerful? > > (9!:3) 5 2 NB. Box and linear representations... > > > o=. @: > c=. "_ > > ar=. 5!:1@:< > an=. <@:((,'0') ,&:< ])f. NB. Atomizing (monadic verb) > > d=. (a0=. `'') (a1=. (@:[) ((<'&')`) (`:6)) (a2=. (`(<(":0);_)) (`:6)) > av=. ((ar'a0')`) (`(ar'a1')) (`(ar'a2') ) (`:6) > NB. Adverbing a monadic verb (adv) > assert 1 4 9 -: 1 2 3 *: av > > train=. (<'`:') (0:`)(,^:)&6 > fix=. (<'f.') (0:`)(,^:) > > af=. an o fix f. NB. Atomizing after fixing a word (monadic verb) > aw=. < o ((0;1;0)&{::) NB. Fetching the atomic representation (monadic > verb) > a3=. (o (train o aw f.)) ('av'f.) > NB. train o aw gets the (noun or verb) argument > > adv=. train o ((af'c') ; ] ; (af'a3')c) f.av > > The motivation for producing the tacit adverb adv was to reduce directly > the production of tacit adverbs to the production of tacit verbs, > > ag=. (0:`)(,^:) (<@:) (@:(train f.))("0) (train f.@:([ ; (,<,',') ; > ])&>/@:) > > A=. @:] > > Ad=. ag adv > > v1`v2`v3`v4 (ar'A')Ad > v1@:] , v2@:] , v3@:] , v4@:] > ┌─────────┬─┬─────────────────────────────────────┐ > │┌──┬──┬─┐│,│┌─────────┬─┬───────────────────────┐│ > ││v1│@:│]││ ││┌──┬──┬─┐│,│┌─────────┬─┬─────────┐││ > │└──┴──┴─┘│ │││v2│@:│]││ ││┌──┬──┬─┐│,│┌──┬──┬─┐│││ > │ │ ││└──┴──┴─┘│ │││v3│@:│]││ ││v4│@:│]││││ > │ │ ││ │ ││└──┴──┴─┘│ │└──┴──┴─┘│││ > │ │ ││ │ │└─────────┴─┴─────────┘││ > │ │ │└─────────┴─┴───────────────────────┘│ > └─────────┴─┴─────────────────────────────────────┘ > > AR=: 1 : '5!:1 <''u''' > advE =: 1 : 'AR(u`)(`:6)' > > AdE=. ag advE > > v1`v2`v3`v4 (ar'A')AdE > v1@:] , v2@:] , v3@:] , v4@:] > ┌─────────┬─┬─────────────────────────────────────┐ > │┌──┬──┬─┐│,│┌─────────┬─┬───────────────────────┐│ > ││v1│@:│]││ ││┌──┬──┬─┐│,│┌─────────┬─┬─────────┐││ > │└──┴──┴─┘│ │││v2│@:│]││ ││┌──┬──┬─┐│,│┌──┬──┬─┐│││ > │ │ ││└──┴──┴─┘│ │││v3│@:│]││ ││v4│@:│]││││ > │ │ ││ │ ││└──┴──┴─┘│ │└──┴──┴─┘│││ > │ │ ││ │ │└─────────┴─┴─────────┘││ > │ │ │└─────────┴─┴───────────────────────┘│ > └─────────┴─┴─────────────────────────────────────┘ > > (By the way, you might appreciate that both adv and advE, in this context, > are acting as triple (Curried) adverbs.) > > The end result is the same; however, one important difference is that > (ar'A')Ad is tacit but (ar'A')Ad is not (because AR is not tacit). Recall, > Piet Google was asking for "a (tacit) way to apply an adverb to each of a > list of verbs." > > Furthermore, adv has the implicit tacit power (provided by (0:`)(,^:)) to > perform forbidden tricks that advE cannot; adv actually applies its > argument verb to the argument of the resulting adverb even if that argument > happens to be a verb; for example, > > *: <adv > ┌──┐ > │*:│ > └──┘ > > boxes *:, > > > *: <adv 1 2 3 > 1 4 9 > > In contrast, > > *: <advE > < *: > ┌─┬──┐ > │<│*:│ > └─┴──┘ > > *: <advE 1 2 3 > 0 1 1 > > > On Thu, Aug 16, 2018 at 3:11 PM, 'Pascal Jasmin' via Programming < > programm...@jsoftware.com> wrote: > > > A simpler version of your usual adv definition, that seems pretty clean > > (without my usual processing) > > > > AR=: 1 : '5!:1 <''u''' > > adv =: 1 : 'AR(u`)(`:6)' > > > > > > 1 2 3 *: adv > > > > 1 4 9 > > > > not sure if this works with all your utilities. > > > > On Wednesday, August 15, 2018, 7:52:50 p.m. EDT, Jose Mario Quintana < > > jose.mario.quint...@gmail.com> wrote: > > > > There are two ways, to produce tacitly what you want: the easy (at least > > for me) wicked way and the hard orthodox way. Life is short; so, I will > > only show the former. Raul already commented on this method and it > > involves cloaking adverbs and conjunctions as monadic and dyadic verbs, > > respectively. > > > > NB. Beware of line-wrapping! > > > > (9!:3) 5 2 NB. Box and linear representations... > > > > o=. @: > > > > The adverb (0:`)(,^:) is the key to the black magic kingdom's door. It > > takes advantage that the power gerundial form allows the items of its > > gerund to represent adverbs and conjunctions. Mind you, this is a wicked > > place and takes time and practice to cast the spells. (Save your work!) > > > > Thus, > > > > evoke=. (<'`:') (0:`)(,^:) > > > > cloaks the conjunction whose atomic representation (ar) is (<'`:') (i.e., > > `:) as a dyadic verb, and > > > > train=. evoke&6 > > > > becomes a monadic verb corresponding to the adverb `:6, > > > > train <'/' > > / > > ┌─┐ > > │/│ > > └─┘ > > > > That is right, the verb train just produced an adverb... That is highly > > illegal! Yet, now one can, among other things, operate directly on verbs > > as if they were nouns. Assume that one wants to produce the verb v1/ , > v2/ > > , v3/ , v4/ from the gerund (v1`v2`v3`v4). Then, one can operate on the > > components of the gerund ("0); producing the corresponding verbs (train) > > and applying ( (<'/') (0:`)(,^:) ) the adverb whose ar is <'/' (i.e. /) > to > > them as a verb; boxing them (<) to produce a boxed array of verbs; and > > finally inserting the verb append (,) between every verb forming forks > > (train o ([ ; (,<,',') ; ])&>/); that is, > > > > train o ([ ; (,<,',') ; ])&>/ o (< o ( (<'/') (0:`)(,^:) ) o train ("0)) > > v1`v2`v3`v4 > > v1/ , v2/ , v3/ , v4/ > > ┌──────┬─┬────────────────────────────┐ > > │┌──┬─┐│,│┌──────┬─┬─────────────────┐│ > > ││v1│/││ ││┌──┬─┐│,│┌──────┬─┬──────┐││ > > │└──┴─┘│ │││v2│/││ ││┌──┬─┐│,│┌──┬─┐│││ > > │ │ ││└──┴─┘│ │││v3│/││ ││v4│/││││ > > │ │ ││ │ ││└──┴─┘│ │└──┴─┘│││ > > │ │ ││ │ │└──────┴─┴──────┘││ > > │ │ │└──────┴─┴─────────────────┘│ > > └──────┴─┴────────────────────────────┘ > > > > One can produce a fixed adverb (ag) that produces the verb above using > the > > ar of the adverb as its argument, to make it reusable, > > > > ag=. (0:`)(,^:) (<@:) (@:(train f.))("0) (train f.@:([ ; (,<,',') ; > > ])&>/@:) > > > > So, > > > > (<'/') ag v1`v2`v3`v4 > > v1/ , v2/ , v3/ , v4/ > > ┌──────┬─┬────────────────────────────┐ > > │┌──┬─┐│,│┌──────┬─┬─────────────────┐│ > > ││v1│/││ ││┌──┬─┐│,│┌──────┬─┬──────┐││ > > │└──┴─┘│ │││v2│/││ ││┌──┬─┐│,│┌──┬─┐│││ > > │ │ ││└──┴─┘│ │││v3│/││ ││v4│/││││ > > │ │ ││ │ ││└──┴─┘│ │└──┴─┘│││ > > │ │ ││ │ │└──────┴─┴──────┘││ > > │ │ │└──────┴─┴─────────────────┘│ > > └──────┴─┴────────────────────────────┘ > > > > of course, one can now supply an arbitrary (tacit or explicit) adverb via > > its ar, > > > > ar=. 5!:1@< > > > > A=. @:] > > > > (ar'A') ag v1`v2`v3`v4 > > v1@:] , v2@:] , v3@:] , v4@:] > > ┌─────────┬─┬─────────────────────────────────────┐ > > │┌──┬──┬─┐│,│┌─────────┬─┬───────────────────────┐│ > > ││v1│@:│]││ ││┌──┬──┬─┐│,│┌─────────┬─┬─────────┐││ > > │└──┴──┴─┘│ │││v2│@:│]││ ││┌──┬──┬─┐│,│┌──┬──┬─┐│││ > > │ │ ││└──┴──┴─┘│ │││v3│@:│]││ ││v4│@:│]││││ > > │ │ ││ │ ││└──┴──┴─┘│ │└──┴──┴─┘│││ > > │ │ ││ │ │└─────────┴─┴─────────┘││ > > │ │ │└─────────┴─┴───────────────────────┘│ > > └─────────┴─┴─────────────────────────────────────┘ > > > > Furthermore, one can cloak the verb (ag) as an adverb (Ag) to hide the > > black magic by cloaking ag using a utility adverb (adv), > > > > Ad=. ag adv > > > > v1`v2`v3`v4 (ar'A')Ad > > v1@:] , v2@:] , v3@:] , v4@:] > > ┌─────────┬─┬─────────────────────────────────────┐ > > │┌──┬──┬─┐│,│┌─────────┬─┬───────────────────────┐│ > > ││v1│@:│]││ ││┌──┬──┬─┐│,│┌─────────┬─┬─────────┐││ > > │└──┴──┴─┘│ │││v2│@:│]││ ││┌──┬──┬─┐│,│┌──┬──┬─┐│││ > > │ │ ││└──┴──┴─┘│ │││v3│@:│]││ ││v4│@:│]││││ > > │ │ ││ │ ││└──┴──┴─┘│ │└──┴──┴─┘│││ > > │ │ ││ │ │└─────────┴─┴─────────┘││ > > │ │ │└─────────┴─┴───────────────────────┘│ > > └─────────┴─┴─────────────────────────────────────┘ > > > > (Ad is a Curried (a.k.a. double) adverb that effectively takes two > > arguments ((v1`v2`v3`v4) and (ar'A')). If you are interested in adv, you > > can search for 'adv=.' in the forum archives (I can also give you a > > reference, if necessary). > > > > I hope this is, at least, amusing. ;) > > > > > > On Wed, Aug 15, 2018 at 1:05 PM, pietdion <pietd...@gmail.com> wrote: > > > > > Thanks for your answer. But I can't understand it. > > > Here is what I want to do. > > > I have an adverb called av say. > > > Also have verbs say v1, v2, v3. > > > Then I want the verb > > > > > > v=. (v1 av) , (v2 av) , (v3 av) > > > > > > Of course I can write it out as in the last sentence above, but I was > > > hoping to be able just to define a gerund > > > > > > g=.v1`v2`v3 > > > > > > and then "apply" av to g. > > > > > > > > > > > > > > > > > > > > > On Thu, Aug 16, 2018 at 1:35 AM, Raul Miller <rauldmil...@gmail.com> > > > wrote: > > > > > > > Generally speaking, its a good idea to include an illustrative use > > > > case with a specification, so let's make up one: > > > > > > > > Let's say my keyboard is getting worn out, and I have to hit the ` > key > > > > an arbitrary number of times before it works. So I want to be able to > > > > form gerunds without using that key. > > > > > > > > So, let's write a tacit adverb which takes a verb train and flattens > > > > it into a gerund. > > > > > > > > The first step is easy: > > > > > > > > (a b c d)(`'') > > > > +-------------------+ > > > > |+-+---------------+| > > > > ||2|+-+-----------+|| > > > > || ||a|+-+-------+||| > > > > || || ||3|+-+-+-+|||| > > > > || || || ||b|c|d||||| > > > > || || || |+-+-+-+|||| > > > > || || |+-+-------+||| > > > > || |+-+-----------+|| > > > > |+-+---------------+| > > > > +-------------------+ > > > > > > > > And we can build up a tacit verb which performs the needed transform: > > > > > > > > isT=: 0:`((-:&(,'2')+-:&(,'3'))@((0;0)&{::))@.(1<:L.) > > > > t2g=: (}:,t2g@,@{:)@((0;1)&{::)^:isT > > > > > > > > t2g (a b c d)(`'') > > > > +-+-+-+-+ > > > > |a|b|c|d| > > > > +-+-+-+-+ > > > > > > > > But now we get to the tricky part. > > > > > > > > Conceptually, we want to do something like this: > > > > > > > > T2G=: (`'')((t2g`)(`:6)) > > > > > > > > But that doesn't actually work. The problem is that we need to > > > > transform that initial gerund to a noun representation of a gerund > > > > before this can work: > > > > > > > > T2G=: (`'')G2g((t2g`)(`:6)) > > > > > > > > In other words, we want an adverb G2g which behaves like the verb > > ('0';<) > > > > > > > > That's doable, and if you search the forum you can find posts by Jose > > > > Mario Quintana which do the needed work (you incorporate that gerund > > > > into a verb built with (&[) and then extract the relevant subtree). > > > > The modularity of his approach is a little different from what I've > > > > described here, but now that you know what you're looking for, that > > > > shouldn't stop you... > > > > > > > > I hope this helps, > > > > > > > > -- > > > > Raul > > > > > > > > > > > > On Wed, Aug 15, 2018 at 4:03 AM Piet Google <pietd...@gmail.com> > > wrote: > > > > > > > > > > Maybe already answered elsewhere and/or an ignorant question. > > > > > But can’t figure it out. > > > > > Is there a (tacit) way to apply an adverb to each of a list of > verbs? > > > > > > > > > > ------------------------------------------------------------ > > ---------- > > > > > 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 > > > > > ---------------------------------------------------------------------- > > 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 > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm