[Re-sending now that the lists are back up]

Conditional NSExpressions (NSConditionalExpressionType) were added in 2015, but 
Apple’s predicate format syntax document* hasn’t been updated, so I can’t find 
any description of what the syntax is for them in a predicate string.

By reverse-engineering (creating a conditional expression programmatically and 
then calling -description on it) I found that the syntax “TERNARY(test, iftrue, 
if false)” works. But this is pretty ugly**; I was hoping there was a cleaner 
syntax like “test ? iftrue : iffalse” or the more SQL-like “IF test THEN iftrue 
ELSE iffalse”. Would anyone happen to know if there’s an alternate 
non-functional syntax?

—Jens

* 
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Predicates/Articles/pSyntax.html
 
<https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Predicates/Articles/pSyntax.html>
** Unless you’re a LISP fan, I guess
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to