One solution I've used in the past was to pass in an array, and put the value to be returned in the array. It's really ugly, and it's not my preferred way of doing things.
What I do now is declare a new class to hold the multiple values.
It would be nicer to be able to be able to declare something like this
Tuple<Integer,Integer,Integer> get3Numbers();
and then call it with
a, b, c = get3Numbers();
or
(a, b, c) = get3Numbers();
where a, b, and c are ints in this example.
No comments:
Post a Comment