How to filter a list in J?
问题 I'm currently learning the fascinating J programming language, but one thing I have not been able to figure out is how to filter a list. Suppose I have the arbitrary list 3 2 2 7 7 2 9 and I want to remove the 2s but leave everything else unchanged, i.e., my result would be 3 7 7 9 . How on earth do I do this? 回答1: The short answer 2 (~: # ]) 3 2 2 7 7 2 9 3 7 7 9 The long answer I have the answer for you, but before you should get familiar with some details. Here we go. Monads, dyads There