I don't know what you mean, but filtering and selection can be accomplished in 
many ways in J.  The most fundamental, in my
opinion, is  #  .  To wit:

           ] some_numbers =. 5 ? 10
        2 7 1 9 5

           greater_than_4 =. 4 < ]
        
           ] mask =. greater_than_4 some_numbers
        0 1 0 1 1
        
           mask # some_numbers
        7 9 5
           
           (#~ 4 < ]) some_numbers
        7 9 5


Here,  mask  was a boolean list which indicated which elements of  some_numbers 
 to keep and which to discard.  That is, told   #
which elements to filter.  

My mnemonic for was (when I started), that  #  looks like a little net or 
sieve.  When you put things in a net, you lose whatever
lies over a hole, and you keep everything else.  In a boolean list, the 0s 
(little circles, absences) are the holes, and the 1s
the lines (presences), which together make up the net.

-Dan

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to