Concise method / method reference

Remi Forax forax at univ-mlv.fr
Sun Sep 30 13:35:25 UTC 2018


Hi all,
i've played a little bit with the concise method prototype.

i think that using '=' to 'assign' a method reference to a method signature
- is visually too close to a field assignment.
- send the wrong message because there is no assignment at runtime.

A way to avoid the issue listed above is to replace '=' with a keyword.

So instead of
  static IntConsumer bar() = FieldVersusMethod::foo;
  static IntConsumer bar = FieldVersusMethod::foo;

using 'as' as keyword, we have 
  static IntConsumer bar() as FieldVersusMethod::foo;
  static IntConsumer bar = FieldVersusMethod::foo;

'as' is perhaps not the best keyword here, but you get the idea.

regards,
Rémi



More information about the amber-spec-experts mailing list