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

Group
 
 

bug #46418: NSPredicate is missing a predicateWithBlock implementation

Submitter:  Vincent Woo <akanet>
Submitted:  Tue 10 Nov 2015 11:33:36 PM UTC
   
 
Category:  Base/Foundation Severity:  2 - Minor
Item Group:  Change Request Status:  Ready For Test
Privacy:  Public Assigned to:  None
Open/Closed:  In Test
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group 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>
Group Member
Wed 09 Mar 2016 10:59:32 AM UTC, comment #2: 

I guess I can do this

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

Anyone want to contribute this?

Richard Frith-Macdonald <CaS>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-09 thebeing StatusNone Ready For Test
    2016-03-09 thebeing Assigned tothebeing None
        Open/ClosedOpen In Test
    2016-03-09 thebeing Assigned toNone thebeing
    2016-03-08 CaS Severity3 - Normal 2 - Minor
        Item GroupNone Change Request

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code