Note also that right rank does have significance here: $(+"_ 1 2/~)i. 3 5 5 3 5 3 5 5 $(+"_ 1 3/~)i. 3 5 5 |length error
(In other words, remember that the definition of u always matters.) Thanks, -- Raul On Sun, Dec 3, 2017 at 9:06 AM, Joe Bogner <[email protected]> wrote: > Thanks for the suggestion to reread and dig into / . I reread the docs and > they are clear now. The bits that stick out to me that are relevant to my > problem: > > "1. If the rank of u is not 0, it doesn't produce a table"[1] > > This seems to be a reference to "u/ y is equivalent to x u"(lu,_) y where > lu is the left rank of u ."[2] in the dictionary > > So back to your first reply > > This verb has left rank of 0 which means it will result in a table > > (0&= @ |~) b.0 > _ 0 0 > > Whereas this is _ meaning it won't be a table > > (~: *. (0&= @ |~)) b.0 > _ _ _ > > > But if we force the left rank it will return a table: > > > (~: *. (0&= @ |~))"(0,_)~ (5,9,2,8) > 0 0 0 0 > 0 0 0 0 > 0 0 0 0 > 0 0 1 0 > > (~: *. (0&= @ |~))"0/~ (5,9,2,8) > 0 0 0 0 > 0 0 0 0 > 0 0 0 0 > 0 0 1 0 > > The only remaining question is: are all forks infinite rank? I tested with > b.0 different examples and they all seem to be. I assumed the rank of a > fork would be the rank of the middle tine, g. If all forks aren't rank > infinite, what determines the rank of the fork? Admittedly my rank > knowledge is still developing even after several years of J use > > > [1] - http://code.jsoftware.com/wiki/Vocabulary/slash#dyadic > [2] - http://www.jsoftware.com/help/dictionary/d420.htm > > > On Sat, Dec 2, 2017 at 3:49 PM, Henry Rich <[email protected]> wrote: > >> Please elaborate on what confused you in that article. [May I say, if you >> want to learn about x u/ y, there's much more information on the page for >> that primitive rather than the page for {y ]. >> >> The inner verb rank of u/ DOES matter. It's crucial. Please read the >> page on x u/ y and then tell me if you still think the docs need more work. >> >> Henry Rich >> >> >> On 12/2/2017 3:07 PM, Joe Bogner wrote: >> >>> Thanks Henry & Raul - I figured it was rank but couldn't figure out why. I >>> guess I assumed it would somehow use the rank of the tines. >>> >>> This NuVoc article is what tripped me up - >>> http://code.jsoftware.com/wiki/Vocabulary/curlylf >>> >>> Specifically this example got me thinking that the 'inner' verb rank >>> mattered, but it was just my misread of the parentheses (there is no inner >>> verb!) >>> >>> 0 1 (<@,"0)/ 7 8 9 >>> >>> vs >>> >>> 0 1 (<@,)"0/ 7 8 9 >>> >>> vs >>> >>> 0 1 <@,"0/ 7 8 9 >>> >>> all are the same, but it doesn't mean that placing rank inside the verb >>> for >>> the / adverb matters. Sharing in case it helps someone else... >>> >>> Thanks again >>> >>> On Sat, Dec 2, 2017 at 2:39 PM, Henry Rich <[email protected]> wrote: >>> >>> Rank. >>>> >>>> (~: *. (0&= @ |~)) b. 0 >>>> _ _ _ >>>> (0&= @ |~) b. 0 >>>> _ 0 0 >>>> ~: b. 0 >>>> _ 0 0 >>>> >>>> Henry Rich >>>> >>>> >>>> >>>> On 12/2/2017 2:34 PM, Joe Bogner wrote: >>>> >>>> I was working on my adventofcode solution earlier today and was stuck and >>>>> still can't figure out why this doesn't work. >>>>> >>>>> Take this expression. >>>>> >>>>> (0&= @ |~)/~ 5 9 2 8 >>>>> >>>>> 1 0 0 0 >>>>> >>>>> 0 1 0 0 >>>>> >>>>> 0 0 1 0 >>>>> >>>>> 0 0 1 1 >>>>> >>>>> >>>>> And this expression >>>>> >>>>> >>>>> (~:)/~ 5 9 2 8 >>>>> >>>>> 0 1 1 1 >>>>> >>>>> 1 0 1 1 >>>>> >>>>> 1 1 0 1 >>>>> >>>>> 1 1 1 0 >>>>> >>>>> >>>>> Why can't I combine it into a single fork to AND the two tines? >>>>> >>>>> >>>>> (~: *. (0&= @ |~))/~ 5 9 2 8 >>>>> >>>>> 0 0 0 0 >>>>> >>>>> >>>>> >>>>> Instead I have to do this >>>>> >>>>> >>>>> (~:/~ *. (0&= @ |~)/~) 5 9 2 8 >>>>> >>>>> 0 0 0 0 >>>>> >>>>> 0 0 0 0 >>>>> >>>>> 0 0 0 0 >>>>> >>>>> 0 0 1 0 >>>>> ---------------------------------------------------------------------- >>>>> For information about J forums see http://www.jsoftware.com/forums.htm >>>>> >>>>> >>>> --- >>>> This email has been checked for viruses by AVG. >>>> http://www.avg.com >>>> >>>> ---------------------------------------------------------------------- >>>> 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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
