When I do this, knowing that I'm only ever going to have a list and not a matrix, I use:
count =: 4 : '+/x=y'
Or for multiple searches in the list:
count =: 4 : '+/x=y'"0 1
Your method copies over only the elements that are equal to x, then counts the result. Summing the ones for equality is one less operation.
MPelletier
2010-09-26 18:11:31