Multiple return (was: JEP 186: Collection Literals)
john.r.rose at oracle.com
Wed Jan 22 12:49:25 PST 2014
On Jan 22, 2014, at 8:26 AM, Alessio Stalla <alessiostalla at gmail.com> wrote:
> you only have to
> be aware of extra return values where you actually want to use them
(I'm a CL expatriate...) This aspect is convenient when the second value is "weak" as you say, but error prone if it is "strong".
Here's what we could do:
Take Java, mix in tuple types (as value types or sugar on top), add target typing and overloading. Shake together, and obtain optionally weak secondary return values. When the secondary return value is strong, you require the user to accept a tuple return value. When it is weak, you overload single and double-returning signatures on the method.
More information about the lambda-dev