overload patterns/anti-patterns

Doug Lea dl at cs.oswego.edu
Sat Dec 29 07:10:32 PST 2012


On 12/29/12 09:59, Brian Goetz wrote:
>> My current sense is that, no matter how much lambda-overload
>> matching is tweaked, this will remain a common API design
>> gotcha, and the best advice is to never overload solely
>> on function type.
>
> ... where the function types have the same arity.

.. of arguments. The "x -> foo()" vs "x -> { foo(); }"
issue (and variants) ambiguate cases of no result vs a result.


> Similarly, it is a key goal to make overloading on specialized return type safe,

Modulo the above? Or is this an important enough goal to require
that void actions use braces?

-Doug



More information about the lambda-libs-spec-observers mailing list