This doesn't use insert, but it is completely tacit.

   f=:[:<"2[,:"1],\~[:-[:#[

   'key2' f 'another_arbitrary_string'

+----+----+----+----+----+----+

|key2|key2|key2|key2|key2|key2|

|anot|her_|arbi|trar|y_st|ring|

+----+----+----+----+----+----+

On Tue, Jan 17, 2017 at 10:29 AM, 'Pascal Jasmin' via Programming <
[email protected]> wrote:

> almost tacit,
>
> _3 'key' 1 : '<@(m ,: ])\'  'arbitrary_string'
>
> what I mean by almost is that
>
>   'key' 1 : '<@(m ,: ])\'
> <@('key' ,: ])\
>
> is resolved to a tacit verb.
>
>
>
>
> ----- Original Message -----
> From: Mark Allen <[email protected]>
> To: Programming forum <[email protected]>
> Sent: Tuesday, January 17, 2017 12:09 PM
> Subject: [Jprogramming] Tacit definition of infix similar to special
> gerund     form of amend
>
> I have the following line of J:
>
>
> _3 (<@:('key'&,:)\) 'arbitrary_string'
>
> ┌───┬───┬───┬───┬───┬───┐
>
> │key│key│key│key│key│key│
>
> │arb│itr│ary│_st│rin│g  │
>
> └───┴───┴───┴───┴───┴───┘
>
>
> I would like to define it entirely tacitly, i.e. I want a verb *f *such
> that
>
>
> 'abc' f\ 'arbitrary_string'
>
> ┌───┬───┬───┬───┬───┬───┐
>
> │key│key│key│key│key│key│
>
> │arb│itr│ary│_st│rin│g  │
>
> └───┴───┴───┴───┴───┴───┘
>
>
> and similarly.
>
>
> 'key2' f\ 'another_arbitrary_string'
>
> ┌────┬────┬────┬────┬────┬────┐
>
> │key2│key2│key2│key2│key2│key2│
>
> │anot│her_│arbi│trar│y_st│ring│
>
> └────┴────┴────┴────┴────┴────┘
>
>
> This can be done easily enough in a piecemeal fashion by first boxing the
> infixes of the RHS and then laminating the LHS with each of the infixes,
> i.e.
>
>
> 'abc' ([ ,:&.:>"(1 0) (<\~ -@:#)~) 'arbitrary_string'
>
> ┌───┬───┬───┬───┬───┬───┐
>
> │abc│abc│abc│abc│abc│abc│
>
> │arb│itr│ary│_st│rin│g  │
>
> └───┴───┴───┴───┴───┴───┘
>
>
> however, after the special gerund form of amend:
>
>
> x (v0`v1`v2) } y <--> (x v0 y) (x v1 y) } (x v2 y)
>
>
> I'd expect that there was some equivalent way of writing my verb f above,
> e.g. something like
>
>
> 'abc' (-@:#@:[ ` <@:,: ` ])\ 'arbitrary_string'
>
>
> Is there any such way?
> ----------------------------------------------------------------------
> 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