Extension methods and API evolution

Mark Reinhold mr at sun.com
Wed Dec 16 09:00:11 PST 2009


> Date: Fri, 11 Dec 2009 12:02:50 +0100
> From: Patrick Wright <pdoubleya at gmail.com>

> I'd like to restate a comment regarding declaration-site extension
> methods that I posted to Peter Ahé's blog when he suggested them a
> couple of years ago
> (http://digital-sushi.org/entry/declaration-site-extension-methods/).
> 
> Use-site extension methods have the advantage that the extension
> methods are not necessarily part of the JDK. ...
> 
> I understand the risk of creating "dialects" of code by allowing
> use-site extension methods, but I think the alternative is simply too
> restrictive.

I understand your view, but I can't agree.  One of the primary values
of the Java language is its inherent readability.  Use-site extension
methods, like many other oft-requested features (e.g., macros), would
significantly degrade that value.

- Mark


More information about the lambda-dev mailing list