On Tue, Oct 5, 2010 at 2:44 AM, Niels Grewe
<niels.grewe@halbordnung.de> wrote:
On Tue, Oct 05, 2010 at 12:07:33AM +0800, Koh Nyap-Hong wrote:
> Yes, basically what I want to do with NSPredicate can actually achieved using
> the traditionally way of while/for loop. However I was recently impressed by
> functional programming way of filtering array/list, I would like to try the
> declarative way of filtering array (I know NSPredicate way of filtering is
> actually just kind of declarative).
I don't know if this really fits your bill, but if you're just looking
for a concise way of manipulating collections, you could also try out
the higher-order messaging APIs in EtoileFoundation [0], which allow you
to do stuff like this:
[[pitches filter] isEqualToString: @"Do"];
[[[pitches filter] description] isEqualToString: @"Do"];
(Note that this requires pitches to be a mutable collection)
Cheers,
Niels
--
[0] http://svn.gna.org/svn/etoile/trunk/Etoile/Frameworks/EtoileFoundation