Aha. I was hoping it's an error in the documentation x (v0`v1`v2)} y ↔ (x v0 y) (x v1 y)} (x v2 y) (v0`v1`v2)} y ↔ (v1 y)} (v2 y) NB. it would be logical to have (v0 y) on the left. but it's not about logic! (v1`v2)} y ↔ (v1 y)} (v2 y)
On Fri, Jan 6, 2017 at 3:21 AM, Henry Rich <[email protected]> wrote: > You are using the verb (monad }). You need (dyad }). > > Henry Rich > > > On 1/5/2017 8:16 PM, Moon S wrote: >> >> Hm, and v0`v1`v2 has some quirks... >> >> v0=:_1 1&*@{. NB. head item, multiplied by _1 1 >> v1=:_2&{. NB. two last items show the place where to put the >> above >> v2=:0 0 0 0"_ NB. initial vector >> >> v0 5 2 3 >> _5 5 >> v1 5 2 3 >> 2 3 >> v2 5 2 3 >> 0 0 0 0 >> >> (_5 5)(2 3) } (0 0 0 0) NB. as nouns, this all works >> 0 0 _5 5 >> >> v0`v1`v2} 5 2 3 >> |rank error >> >> >> Even simpler example misbehaves: >> >> 5 (2}) 1 1 1 1 >> 1 1 5 1 >> >> (5*]) 1 >> 5 >> (2*]) 1 >> 2 >> (4#]) 1 >> 1 1 1 1 >> >> ((5*])`(2*])`(4#]) }) 1 NB. ??? >> 1 >> >> On Fri, Jan 6, 2017 at 2:29 AM, 'Pascal Jasmin' via Programming >> <[email protected]> wrote: >>> >>> (+/)`%`# 1 : ' ''`f g h'' =. m label_. (f g h) f.' >>> +/ % # >>> >>> >>> >>> >>> ----- Original Message ----- >>> From: Moon S <[email protected]> >>> To: programming <[email protected]> >>> Sent: Thursday, January 5, 2017 7:26 PM >>> Subject: Re: [Jprogramming] Tacit definition involving adverb argument >>> >>> Ah! The special form for } >>> >>> x (v0`v1`v2)} y >>> >>> Great! >>> >>> What about a user-defined adverb? If I define an adverb to pretend I >>> can have three parameters. >>> >>> >>> On Fri, Jan 6, 2017 at 1:53 AM, 'Pascal Jasmin' via Programming >>> <[email protected]> wrote: >>>> >>>> 11 22 33&( 0:`(<:@])`[}) 2 >>>> 11 0 33 >>>> >>>> >>>> ----- Original Message ----- >>>> From: Moon S <[email protected]> >>>> To: programming <[email protected]> >>>> Sent: Thursday, January 5, 2017 6:36 PM >>>> Subject: [Jprogramming] Tacit definition involving adverb argument >>>> >>>> Is there a tacit definition of such a verb? Is there a way to pass a >>>> value to the adverb? >>>> >>>> f =: 3 : '0 (<:y)} 11 22 33' >>>> >>>> f 1 >>>> 0 22 33 >>>> f 2 >>>> 11 0 33 >>>> >>>> >>>> PS. Also, I couldn't suspect that besides a usual definition of dyad >>>> adverb such as >>>> >>>> 1 : ('';':';'...x...m...y...') NB. explicit defs inside >>>> >>>> there's also a shorter way: >>>> >>>> 1 : '...[...x...]...' NB. tacit defs inside >>>> >>>> Of course the reading of The Phrases is very useful... but so hard! >>>> ---------------------------------------------------------------------- >>>> 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 > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
