> Am 18.06.2018 um 17:59 schrieb David Chisnall <[email protected]>:
> 
> On 18 Jun 2018, at 16:49, amon <[email protected]> wrote:
>> 
>> So you are saying this would be good to go?
>> 
>> NSUInteger i;
>> NSMutableArray *a;
>> NSEnumerationOptions opts;
>> GSPredicateBlock      predicate = ^() { return YES; }
>> 
>> i = [a indexOfObjectWithOptions: opts passingTest: predicate];
> 
> No, because that block does not take the correct number of arguments.  It 
> might compile, but it would be undefined behaviour.  You must define a block 
> that takes three arguments:

I might be wrong here, but I think that with all compilers that I know about 
that code should work. The compiler will complain about the type mismatch but 
if you do not access the arguments you should be able to have them on the stack 
with any issue.
Of course your example is a lot more correct (and actually useful!) but the 
code above should basically work, although I didn’t try it.


_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to