my utilities, as double adverbs (sorry I guess).  Lot of code that mostly deals 
with flexible transforms of inputs.

strinsert =: 1 : ' [ , u , ]'
quote =: ''''&,@(,&'''')@(#~ >:@(=&''''))daF =: 1 : 'a =. (''2 : '', (quote m) 
, '' u'') label_. 1 : (''u 1 :'' , quote a)'

daF =: 1 : 'a =. (''2 : '', (quote m) , '' u'') label_. 1 : (''u 1 :'' , quote 
a)'
lrA =: 1 : '5!:5 < ''u'''
ncS =: 3 : 'z=.y 1 :y label_. 4!:0 <''z'' ' ::(_2:)
eval =: 1 : 'if. 2 ~: 3!:0 m do. m else. a: 1 : m end.'
ismodstring =: 1 : 'if. 0 = 4!:0 <''u'' do. try. q =. m eval catch. 0 return. 
end. 1 2 e.~ 4!:0 <''q''else. 0 end. '
ncA =: 1 : 'if. 3 ~: 4!:0 < ''u'' do. if. m ismodstring do. m ; ncS m else. 0 
;~ ''('', m lrA ,'')'' end. else. 3;~ ''('', u lrA ,'')'' end.'toG =: 1 : ' if. 
1 2 e.~ 1 {:: u ncA do. a =. (m) eval else. a=.u end. 5!:1 < ''a'''
toG =: 1 : ' if. 1 2 e.~ 1 {:: u ncA do. a =. (m) eval else. a=.u end. 5!:1 < 
''a'''
Cloak=: aar(0:`)(,^:)
combG =: '(`:6)toG' Cloak
isNoun =: (0 = 4!:0 ::0:)@:<
isgerund =: 0:`(0 -.@e. 3 : ('y (5!:0)';'1')"0)@.(0 < L.) :: 0:

isgerundA =: 1 : ' if. isNoun ''u'' do. isgerund m else. 0 end.'


Advsert=: 'if. -. v isgerundA do. n =. v toG end. (combG"1 m ,.(#m) $ n)' daF 
NB. 2 gerund arguments. n coerced to one if not.




*`+`- '/' Advsert `:6

*/ +/ -/
((,`'') strinsert/ +`- '/' Advsert) `:6

+/ , -/







On Wednesday, August 15, 2018, 1:05:51 p.m. EDT, 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

Reply via email to