Hacker News new | ask | show | jobs
by jemeshsu 5228 days ago
Nice. I wish for ability for function to return multiple values. Is it possible at all?
2 comments

Probably not, but with the new dictionary literal syntax, returning a dictionary with a set of keys-values should be a breeze :)
You can use C99 struct literals:

    return (struct x){a,b};
Small structs may be passed in registers. http://stackoverflow.com/a/3355560/27009
IIRC passing Obj-C object pointers in C structs is disallowed or discouraged by ARC.
You have to explicitly bridge them in or out of ARC and indicate the ownership rules. Sometimes, for example when you're interfacing straight C code, you have no other option.