to avoid repeat application of same verb in tacit expression, you can combine 
the first application with the rest of the data, then access intermediate 
results with {:: .  

(u mycurrentmod n ; ])

But in your case you don't need the original data

2 : 0
'`a b' =. u
(b@{. ; }.)@:(a mycurrentmod n )
)






On Tuesday, June 2, 2020, 06:24:19 a.m. EDT, Hauke Rehr 
<[email protected]> wrote: 





wrong again; sorry, v depends on y as well, not only on the
{. of the result of u


Rephrasing using the example modifier I started with:
  |. onsub 2 mat
does what I want it to do.
Let’s divide onsub into two parts, the one before
application of u and the one after, and call them
ons2 and ons1, but both are using [ and ] of the
derived verb.

I want
    (|.;#) newonsub n y
or
    |.`# newonsub n y
(yes, I swapped their order in the last post)
to work like
  (|.@ons2 ; #)@ons1
but still ons2 and ons1 need to refer to the
derived verb’s [ and ]

hopefully I got it right this time.

I think I need some rest and to write it down on paper
before publishing too much incomplete/confusing stuff.


Am 02.06.20 um 12:03 schrieb Hauke Rehr:
> sorry for the bad naming,
> I rewrote it too many times.
> 
> whatshappeningalready is the same as v in my earlier post
> 
> I had a working modifier mymod and wanted
>     (u;v) mymod n y
> or
>     u`v mymod n y
> to work like
>     (v {. u mycurrentmod n y) ; }. u mycurrentmod n y
> but without the two executions of u mycurrentmod n y
> and without assigning its result.
> 
> Am 02.06.20 um 11:53 schrieb Hauke Rehr:
>> What you say is like
>> (}. ;~ whatshappeningalready@{.)@u
>> The problem is:
>> whatshappeningalready uses [ and ] of the enclosing verb
>> (ex- or implicitly)
>> I could do
>> (}. ;~ wha2)@([;];u)
>> for some value of wha2 (an adjusted way of whatshappeningalready)
>> but I thought maybe there’s a more elegant way of achieving this.
>>
>> Am 02.06.20 um 11:39 schrieb Raul Miller:
>>> Probably?
>>>
>>> But you don't need a gerund, just accessors
>>>
>>> Basically, you'll do something like (expr)@:u or ([: expr u), and in
>>> the context of expr, 0&{:: gets the contents of the first box and
>>> 1&{:: gets the contents of the second box.
>>>
>>> You may also want to do something like (expr)@:(+each&(0;0))@:u to
>>> enforce a structure on the result of u.
>>>
>>> That said, once I learned this technique, I discarded it -- I feel
>>> that explicit local names are a better choice.
>>>
>>> Still, this might help?
>>>
>>
> 

-- 
----------------------
mail written using NEO
neo-layout.org

----------------------------------------------------------------------
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