Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  #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.



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: