(note I wrote this earlier and set it aside to research the question about the distort verb. This may now be stale...)
That was correct about ranks: http://www.jsoftware.com/help/dictionary/dictf.htm "The ranks of the hook and fork are infinite." That said, I believe learning j was trying to give you just enough information to give you a basis for experimentation. And, you should be able to measure the rank of fork. So, given http://www.jsoftware.com/help/learning/07.htm "the expression u b. 0 gives the ranks in the order monadic, left, right." (+/ %#) b. 0 _ _ _ Anyways, as to your original question, you can rephrase that in many ways, but I think the core of it is something like this: plot (2 %~ 1 + *@(_1 + 2 * ]) * [ (* % 1 + (2 * *) - +) |@(_1 + 2 * ]))"0/~ a And I see a lot of scaling by two and adjusting by 1 there, to convert between the domain of a (0..1) and numbers you need to work with. So I think I would work on pushing this transform out to the edges. In other words, I would try to write F&.(1 + 2 * ]). (But I have not thought about this enough to decide what F would be.) FYI, -- Raul On Fri, Nov 4, 2011 at 6:30 AM, Ricardo Forno <[email protected]> wrote: > The thing that confused me is that I didn't know a fork has rank _ as > Marshall wrote. Is that correct? Browsing through Learning J, I couldn't > find if this fact is mentioned there. > > ----- Original Message ----- > From: "Henry Rich" <[email protected]> > To: "Programming forum" <[email protected]> > Sent: Friday, November 04, 2011 7:15 AM > Subject: Re: [Jprogramming] Newbie question > > >> Just a quibble with terminology: 'item' means _1-cell. That concept >> does not apply here. If you define 'l-cell' to be the left rank of the >> verb, and 'r-cell' the right rank, you could say >> >> ...it loops through all the l-cells of x, then for each of those, all >> the r-cells of y... >> >> Henry Rich >> >> On 11/4/2011 12:13 AM, Marshall Lochbaum wrote: >>> * has rank 0 already, so it isn't necessary. The definition of / is that >>> it >>> applies the verb with rank (left rank),_ . Essentially, this means that >>> it >>> loops through all the items of x, then for each of those, all the items >>> of >>> y, where an "item" is an item with the left rank of the verb. If you try >>> magic/~ a with magic having rank _ (because it's a fork), you just get (a >>> magic"_ _"_ _ a), which simply applies magic regularly. >>> >>> Marshall >>> >>> On Thu, Nov 3, 2011 at 11:57 PM, Ricardo >>> Forno<[email protected]>wrote: >>> >>>> I have this verb: >>>> magic =: * %>:@(+:@*) - + >>>> that I use only as a dyad, and, say, >>>> a =: 0.1 * i. 10 >>>> If I want to get a table of the * verb, I write: >>>> a * / a >>>> If I write >>>> a magic / a >>>> I dont get a table. To get a table, I have to write: >>>> a magic"0 / a >>>> Why is it so, since both * and magic may be used as dyads? >>>> Thanks. >>>> >>>> >>>> ---------------------------------------------------------------------- >>>> 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
