Just curious, for comparison: what would the equivalent be in Ruby?
filteredArray = [allRecords filteredArrayUsingPredicate:
[NSPredicate predicateWithFormat:@"someField == %d", someFieldFilterValue]];
in ruby: all_records.select {|r| r.some_field == some_field_filter_value}
in clojure: (filter #(= % some-filter-value) all-records)
in haskell: filter (\someField -> x == someFilterValue) allRecords NSIndexSet *indicies = [allRecords indexesOfObjectsPassingTest:^ (id obj, NSUInteger idx, BOOL *stop) { return [obj someField] == someFieldFilterValue; }];
filteredArray = [allRecords objectsAtIndexes:indicies];
rather than what the article had in mind.EDIT: oh, someFieldFilterValue was an integer, wasn't it. Fixed.
At least that's one way to do it in ruby.