[Jprogramming] Am I understanding m/y ?
'Pascal Jasmin' via Programming
programming at jsoftware.com
Tue Jun 14 02:21:37 UTC 2016
+`-/ 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 <j at bron.us>
To: J Programming <programming at jsoftware.com>
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
More information about the Programming
mailing list