bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #47619] NSPredicate: aggregate function expressions implemented inc


From: Niels Grewe
Subject: [bug #47619] NSPredicate: aggregate function expressions implemented incorrectly
Date: Mon, 04 Apr 2016 15:04:41 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17

URL:
  <http://savannah.gnu.org/bugs/?47619>

                 Summary: NSPredicate: aggregate function expressions
implemented incorrectly
                 Project: GNUstep
            Submitted by: thebeing
            Submitted on: Mo 04 Apr 2016 15:04:40 GMT
                Category: Base/Foundation
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

The aggregate function expressions (sum, min, max, avg) in base are
implemented as vararg functions. This is incorrect with respect to the Cocoa
implementation. There they are implemented as single argument functions that
take collections as arguments. 

In particular, the following evaluates truthy:

    NSArray *a = @[ @{ @"count": @1 }, @{ @"count": @1 } ];
    NSPredicate *p = [NSPredicate predicateWithFormat: @"sum(count) == 2"];
    [p evaluateWithObject: a];

(sorry, literal notation for compactness). On GNUstep it raises an
NSInvalidArgumentException (because the array of NSNumbers does not implement
-doubleValue).




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47619>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]