Perhaps easier to see with more formal/expressive verbs:
in =. 1 :'[,'' '',u,'' '',]' NB. String to infix function
('f0'in)`('f1'in)`('f2'in)/ 'abcde'
a f0 b f1 c f2 d f0 e
The verbs in the gerund are arranged from left to right starting at the
beginning of the array, while application (as in the non-gerund case)
proceeds from right to left. I would avoid calling either of these
things "unrolling" without further explanation as it's not clear which
that would mean.
Dan's example has typos, and his wording is vague enough that I can't
tell whether it is correct.
Marshall
On Tue, Jun 14, 2016 at 02:21:37AM +0000, 'Pascal Jasmin' via Programming wrote:
> +`-/ 1 2 3
> 0
> +`+`-/ 1 2 3
> 6
>
>
> I call this as being inserted between items on a right to left basis.
>
> 1 + 2 - 3 + 4
>
> +`-/ 1 2 3 4
> _4
> +`-/ 1 2
> 3
>
>
>
> ----- Original Message -----
> From: Dan Bron <[email protected]>
> To: J Programming <[email protected]>
> Sent: Monday, June 13, 2016 9:04 PM
> Subject: Re: [Jprogramming] Am I understanding m/y ?
>
> Louis wrote:
>
> > There was some talk a while ago about the ambiguity of the dictionary about
> > the direction of gerund insertion. Reading through the first pages of
> > Iverson's Concrete Math Companion, I stumbled on a snippet of J that dates
> > back to 2002 and was written by Iverson at the bottom of page 6:
> >
> > http://www.jsoftware.com/books/pdf/cmc.pdf
> > <http://www.jsoftware.com/books/pdf/cmc.pdf>
> >
> > According to this source, gerunds do indeed "unroll" from left to right
> > correctly in the current implementation.
>
>
> I’m also on mobile, so forgive my terse answer and potential misunderstanding
> of your question, but yes:
>
>
> v0`v1`v2`v3/ y
>
> is indeed:
>
> … (_8{y) v2 (_7{y) v3 (_6{y) v0 (_5{y) v1 (_4{y) v2 (_3{y) v1 (_2{y)
> v0 _1{y
>
> That is, the insertion of verbs starts at the rightmost (last) elements of y,
> but the leftmost (first) elements of the gerund G, where G/y .
>
> The rationale for this is left as an exercise for a less lazy respondent
> (though the right-to-left nature of insertion in y should be familiar to
> veteran J’ers).
>
> -Dan
>
>
>
> ----------------------------------------------------------------------
> 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