bugGNUstep - Bugs: bug #46418, NSPredicate is missing a...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #46418: NSPredicate is missing a predicateWithBlock implementation

Submitted by:  Vincent Woo <akanet>
Submitted on:  Tue 10 Nov 2015 11:33:36 PM UTC  
 
Category: Base/FoundationSeverity: 2 - Minor
Item Group: Change RequestStatus: Ready For Test
Privacy: PublicAssigned to: None
Open/Closed: In Test

Wed 09 Mar 2016 02:10:00 PM UTC, comment #5:

> But ... the second one doesn't pass in OSX-10.11.3 :-(


A bug in the OS X implement IMHO (I'm in the process of preparing the bug report):

On OS X [predicate evaluateWithObject: o substituationVariables: v] works. It is supposed to be a shorthand for [[predicate predicateWithSubstitutionVariables: v] evaluateWithObject: o] (optimising away the allocation of the intermediary object).

It looks like they didn't implement that for block predicates, but we need it to work because we don't have -evaluateWithObject:substitutionVariables: yet.

Niels Grewe <thebeing>
Project Member
Wed 09 Mar 2016 02:02:37 PM UTC, comment #4:

Thanks very much for that ... the testcases pass on my CentOS-7 system.
But ... the second one doesn't pass in OSX-10.11.3 :-(

Richard Frith-Macdonald <CaS>
Project Member
Wed 09 Mar 2016 01:22:15 PM UTC, comment #3:

A fun little lunch break project. Now ready for test in trunk. It needs libobjc2 and clang for testing, though.

Niels Grewe <thebeing>
Project Member
Wed 09 Mar 2016 10:59:32 AM UTC, comment #2:

I guess I can do this

Niels Grewe <thebeing>
Project Member
Tue 08 Mar 2016 10:27:40 PM UTC, comment #1:

Anyone want to contribute this?

Richard Frith-Macdonald <CaS>
Project Member
Tue 10 Nov 2015 11:33:36 PM UTC, original submission:

Here's the Apple reference on the method:

https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSPredicate_Class/#//apple_ref/occ/clm/NSPredicate/predicateWithBlock:

It indicates this has been available since at least OSX 10.6.

GNUStep's NSPredicate implementation seems to be missing this currently: https://github.com/gnustep/base/blob/master/Headers/Foundation/NSPredicate.h

I don't think it should be super hard to implement, but unfortunately I don't know very much ObjC. There's an open TODO on Etoile to add this, so perhaps someone from that project might be able to step in? https://github.com/etoile/CoreObject/blob/master/TODO.md#future-work-minor-features-refactoring-cleanup

Vincent Woo <akanet>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by thebeing (Posted a comment)
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by akanet (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 09 Mar 2016 01:25:58 PM UTCthebeingStatusNone=>Ready For Test
    Wed 09 Mar 2016 01:22:15 PM UTCthebeingAssigned tothebeing=>None
      Open/ClosedOpen=>In Test
    Wed 09 Mar 2016 10:59:32 AM UTCthebeingAssigned toNone=>thebeing
    Tue 08 Mar 2016 10:27:40 PM UTCCaSSeverity3 - Normal=>2 - Minor
      Item GroupNone=>Change Request

    Back to the top


    Powered by Savane 3.1-cleanup1