No mystery here. I was just trying to understand R.E. Boss's examole which was attached right below mine. I enjoyed the journey.
Linda -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Linda Alvord Sent: Saturday, March 29, 2014 9:31 PM To: [email protected] Subject: Re: [Jprogramming] apply verb to filtered list Sorry. These are from the previous example: ]A=:4;'a';3;6 ┌─┬─┬─┬─┐ │4│a│3│6│ └─┴─┴─┴─┘ ]B=:1 0 1 0 1 0 1 0 Linda -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Linda Alvord Sent: Saturday, March 29, 2014 9:22 PM To: [email protected] Subject: Re: [Jprogramming] apply verb to filtered list Here's a journey on the "scenic route": f=: 13 :'(,:~(+: :: ])L:0)y' ]C=:f A ┌─┬─┬─┬──┐ │8│a│6│12│ ├─┼─┼─┼──┤ │4│a│3│6 │ └─┴─┴─┴──┘ 5!:4 <'f' ┌─ ~ ──── ,: │ ┌─ +: ──┤ ┌─ :: ─┴─ ] └─ L: ─┴─ 0 f ,:~ +: ::]L:0 5!:4 <'C' ── 2 4$8;'a';6;12;4;'a';3;6 C ┌─┬─┬─┬──┐ │8│a│6│12│ ├─┼─┼─┼──┤ │4│a│3│6 │ └─┴─┴─┴──┘ B}C ┌─┬─┬─┬──┐ │4│a│3│12│ └─┴─┴─┴──┘ g=: 13 :'x } (,:~(+: :: ])L:0)y' B g A ┌─┬─┬─┬──┐ │4│a│3│12│ └─┴─┴─┴──┘ g 4 : 'x } (,:~(+: :: ])L:0)y' 5!:4 <'g' ┌─ 4 ── : ─┴─ ,:'x } (,:~(+: :: ])L:0)y' Linda -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of R.E. Boss Sent: Friday, March 28, 2014 1:57 PM To: [email protected] Subject: Re: [Jprogramming] apply verb to filtered list Borrowing from Guinn: 1 0 1 0 } (,:~(+: :: ])L:0) 4;'a';3;6 +-+-+-+--+ |4|a|3|12| +-+-+-+--+ R.E. Boss (Add your info to http://www.jsoftware.com/jwiki/Community/Demographics ) > -----Original Message----- > From: [email protected] [mailto:programming- > [email protected]] On Behalf Of Pascal Jasmin > Sent: vrijdag 28 maart 2014 2:27 > To: [email protected] > Subject: Re: [Jprogramming] apply verb to filtered list > > found it: > > 1 0 1 (+:@:])^:[ each 4;'a'; 6 > ┌─┬─┬──┐ > │8│a│12│ > └─┴─┴──┘ > > 1 0 1 ]`(+:@:])@.[ "0 ] 4 1 6 > 8 1 12 > > > > ----- Original Message ----- > From: Pascal Jasmin <[email protected]> > To: Programming forum <[email protected]> > Cc: > Sent: Thursday, March 27, 2014 8:17:06 PM > Subject: [Jprogramming] apply verb to filtered list > > f =: 1 0 1 > list =: 2;'a';3 > > as a simple example verb, +: is used. The verb is of no actual interest. > Only > the adverb. > > I would like an adverb that produces > > 4 1 6 -: 1 0 1 +: adv 2 1 3 > 1 > > or more advanced, > > 4 ;'a'; 6 -: 1 0 1 +: adv 2;'a'; 3 > > 1 > > It is NOT AN OPTION to query the list as part of an each expression. Using > the precalculated filter f is mandatory. > ---------------------------------------------------------------------- > 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
