This PR adds the KVC operators unionOfObjects, distinctUnionOfObjects, unionOfArrays, distinctUnionOfArrays, distinctUnionOfSets for array and set.
Unit-Tests Tests/Foundation/CPKVCArrayTest.j
Unit-Tests Tests/Foundation/CPSetTest.j
- Moved common CPArray/CPSet collection KVC operators to _CPCollectionKVCOperators.
- Implemented KVC operator dispatch using Objective-J.
- Fixed infinite loop with empty collection in @min, @max and @sum operators.
- Correctly return valueForUndefinedKey when necessary.
- valueForUndefinedKey reason uses raw description for consistency, class' overridden description may not helpful at all.
- Don't create a forwarder for @ operators with property paths.
- Fixed CPSet -valueForKeyPath to correctly deal with nil/undefined/empty values.
- Added tests for collection KVC operators.
- enumerator -nextObject should always compare against nil for clarity, correctness, and consistency.
1. CPSet and CPMutableSet are now abstract super classes that create appropriate concrete subclasses behind the scenes.
2. CPSet subclassers need only implement -count, -member:, and -objectEnumerator.
3. CPMutableSet subclassers need only implement -count, -member:, -objectEnumerator:, -addObject:, and removeObject:.
4. Added more CPSet tests.
5. Added _CPKeyValueCodingSet which subclasses CPSet for set returns in valueForKey:.
Reviewed by me.