Lazy evaluation of items in NSPredicates
Lazy evaluation of items in NSPredicates
- Subject: Lazy evaluation of items in NSPredicates
- From: email@hidden
- Date: Sat, 14 May 2005 16:41:57 +1000
I'm just bouncing this off the list before I go off coding, as while
I have a few ideas I'm sure I must be reinventing the wheel.
Basically, I want to use NSPredicate and friends for, well, all the
stuff they do. But, the format strings will be provided by an
outside source, and could contain any number of key paths, of
different types. Some of these may be relatively expensive to
evaluate, thus I don't want to do so if they're not actually used.
So, I'm thinking of ways to perform lazy evaluation. Has anyone else
done this? My first thought is to subclass NSDictionary (well.. it's
probably a class cluster so you can't, but something along those
lines, anyway) or the elements within it, and pass that to
NSPredicate's evaluate method. That seems a reasonably elegant
solution. I also contemplated modifying NSPredicate & friends,
perhaps via categories or subclasses, but that seems inappropriate,
if it's [easily] possible at all.
Wade Tregaskis (AIM/iChat, Yahoo & Skype: wadetregaskis, ICQ:
40056898, MSN, audio/video iChat & email: email@hidden,
Jabber: email@hidden)
-- Sed quis custodiet ipsos custodes?
Wade Tregaskis (AIM/iChat, Yahoo & Skype: wadetregaskis, ICQ:
40056898, MSN, audio/video iChat & email: email@hidden,
Jabber: email@hidden)
-- Sed quis custodiet ipsos custodes?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden