Or: adv=: (@])(1:`)(@.[)(&>) +:adv 1:`(+:@])@.[&> 1 0 1 +: adv 2;'a'; 3 4 1 6
Thanks, -- Raul On Thu, Mar 27, 2014 at 9:26 PM, Pascal Jasmin <[email protected]>wrote: > 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
