News for hackers. Stuff that matters.
Re:In defence of Objective-C by chubs on Monday October 17, 2011 @01:57AM (#3119337)
There's ConciseKit for precisely this problem: https://github.com/petejkim/ConciseKit

We use it in a lot of our code here. Its quite nice. You'll end up with something like:

myDict = $mdict(val, key, val2, key2);

Re:In defence of Objective-C by koenigdavidmj on Monday October 17, 2011 @03:32AM (#3119545)
And the values and keys are still backwards.
Re:In defence of Objective-C by stephth on Monday October 17, 2011 @06:18AM (#3119911)

  #define KV(KEY,VALUE)   VALUE, KEY

  myDict = MD(KV(key,val), KV(key2,val2));
Ugly but a case can be made that this end justifies the means.

Another option is implementing your own dictionaryWithObjectsAndKeys where you flip the varargs and feed them back into the subclass dictionaryWithObjectsAndKeys.

Re:In defence of Objective-C by freemarketteddy on Monday October 17, 2011 @03:02AM (#3119472)
wow thts pretty cool!