3 ms·
What happens under the hood would be the same, but in C you have to define a new struct for each return type which is clunky. In ML or Python you can return ad
by rwmj 7y ago
What happens under the hood would be the same, but in C you have to define a new struct for each return type which is clunky. In ML or Python you can return ad hoc tuples, eg:
let res, _, _ = fun_which_returns_3_tuple ()
vs
struct my_result { int res; int other; int third; };
...
struct my_result r = fun_which_returns_struct ();
printf ("%d\n", r.res);
- deleted 7y ago[deleted]