Simple when you know how...
On 3 May 2014 18:32, Alex Giannakopoulos <[email protected]> wrote: > Thanks again, Joe. No I wasn't missing the picture in the box. Have > pored over it many times. > I just hadn't seen how the OP's initial formulation of a MONADIC verb as a > hook was being tranformed to the dyadic formula. Once I realised that the > *application* of the hook yielded something dyadic. > (x was now the initial y, and y was gx) then all was clear. > > Just FYI. > I thought you might like the insight into the workings of the mind of a > noob, since you went to all that trouble to help... > > > On 3 May 2014 18:27, Alex Giannakopoulos <[email protected]> wrote: > >> Yup, got it now. >> ((m&v)(n&u))y >> => >> y (m&v)((n&u)y) NB. Definition of hook >> >> Since x (m&v) y <=> m&v ^: x y >> y (m&v) ((n&u) y) <=> (m&v) ^: y ((n&u) y) >> >> (The confusing bit was that the y in the initial formulation was the x in >> the dictionary formula, and the y was the whole of ((n&u) y)) >> >> Thanks all >> >> >> >> >> On 3 May 2014 18:13, Alex Giannakopoulos <[email protected]> wrote: >> >>> @Joe: Thanks, I use the same notation for m,n,u,v,x and y (I'd have >>> thought it was obvious. So many other things seem to be around here...) >>> BTW, you are right it is confusing. >>> >>> >>> @R.E.Boss: thanks for the link, and even repeating it. I assure you I >>> have read that page many times before. >>> I must apologize that my level of intelligence does not immediately >>> recognize that what is is listed there completely resolves the OP's >>> question. You'll just have to accept that some dim people like to use J >>> too :) >>> >>> As I cannot immediately see how the info there will reduce the OP's >>> (m&v n&u) y >>> to >>> (m&v) ^:y (n&u y) >>> >>> I will read Joe's post again more attentively, he seems to be steering >>> me the way I want to go. >>> Please don't bother explaining it any more, I think there is enough info >>> for a determined soul, plus I enjoy the challenge. I hope the OP found >>> this as useful and informative as I did. >>> >>> >>> >>> On 3 May 2014 17:06, Joe Bogner <[email protected]> wrote: >>> >>>> > On 3 May 2014 14:22, Alex Giannakopoulos <[email protected]> >>>> wrote: >>>> >> OK, but can't see which part of the docs clarifies that. >>>> >>>> Alex, the dictionary link that R.E. Boss shared, >>>> http://www.jsoftware.com/help/dictionary/d630n.htm, concisely >>>> documents that behavior. I agree it's somewhat confusing. >>>> >>>> It's also covered in the new vocabulary more explicitly: >>>> http://www.jsoftware.com/jwiki/Vocabulary/ampm >>>> >>>> One of the keys to understanding this is being able to recognize what >>>> x,m,v,u,y are. It probably belongs on the NewVoc glossary page, >>>> http://www.jsoftware.com/jwiki/Vocabulary/AbsolutelyEssentialTerms >>>> >>>> One of the better descriptions of x,m,v,u,y,etc I've seen can be found >>>> in the J Brief Reference: http://www.jsoftware.com/books/pdf/brief.pdf >>>> >>>> "Noun arguments to adverbs and conjunctions may be specified by m on >>>> the left and n on the right. Verb >>>> arguments are u and v and the derived functions use x and y to denote >>>> their arguments." >>>> >>>> x,y = arguments >>>> u,v = verbs >>>> m,n = nouns >>>> >>>> Reading the bond dictionary page again, we see the dyadic definition is: >>>> >>>> x m&v y ↔ m&v^:x y >>>> x u&n y ↔ u&n^:x y >>>> >>>> Looking at the sin definition: >>>> sin=: 1&o. >>>> >>>> m is 1 >>>> v is o. >>>> >>>> That would fall under the first case, x m&v y ↔ m&v^:x y >>>> >>>> Substituting in, we see that: >>>> >>>> (4 sin 1) -: ((1&o.^:4) 1) >>>> 1 >>>> >>>> Here's another way to spot the difference: >>>> >>>> Let's start by looking a the difference between m&v and u&n >>>> >>>> NB. m v y <-> >>>> (3&^) 2 NB. 3^2, m&v, square 3 >>>> 9 >>>> >>>> ] m v y [ (m =. 3) [ (v=. ^) [ (y =. 2) >>>> 9 >>>> >>>> NB. y u n >>>> (^&3) 2 NB. 2^3, u&n, cube 2 >>>> 8 >>>> >>>> ] y u n [ (y =. 2) [ (u=. ^) [ (n =. 3) >>>> 8 >>>> >>>> >>>> Now applying it dyadically: >>>> >>>> 2 (3&^) 1 NB. m&v 1 >>>> 27 >>>> >>>> ((3&^)^:2) 1 >>>> 27 >>>> >>>> 3^3^1 >>>> 27 >>>> >>>> NB. execute m v twice >>>> ] (m v (m v y)) [ (m =. 3) [ (v=. ^) [ (y =. 1) >>>> 27 >>>> >>>> >>>> 2 (^&3) 1 NB. u&n, cube >>>> 1 >>>> >>>> ((^&3)^:2) 1 >>>> 1 >>>> >>>> NB. execute y u twice >>>> ] (y u (y u n)) [ (y =. 1) [ (u=. ^) [ (n =. 3) >>>> 1 >>>> >>>> I find the letters m,n,u,v,y,x confusing. My best mnemonic is: >>>> >>>> I can remember n = noun. The letter before it (m) is also a noun >>>> I can remember v = verb. The letter before if (v) is also a verb >>>> I can remember y = is the last argument. The letter before it is x >>>> (left side) >>>> >>>> Hope this helps >>>> ---------------------------------------------------------------------- >>>> For information about J forums see http://www.jsoftware.com/forums.htm >>>> >>> >>> >> > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
