Extension methods

Neal Gafter neal at gafter.com
Fri Nov 20 17:31:46 PST 2009


On Fri, Nov 20, 2009 at 5:34 PM, Rémi Forax <forax at univ-mlv.fr> wrote:

>  There is already an existing mechanism to insert extension methods
> at runtime: interface injection
> (http://openjdk.java.net/projects/mlvm/subprojects.html#InterfaceInjection
> )
>
> This mechanism allow to add an interface + implementation to a class at
> runtime.
>
> Written in Java, it will be something like that:
> package java.util;
> public extension interface ExtMap<K,V> extends Map<K,V> {
>   public Map.entry getEntry(K key) {
>     ...
>   }
> }
>
> package java.util;
> public interface Map<K,V> extension ExtMap<K,V> {
>   ...
> }
>

When at runtime is the extension done?  When ExtMap is statically
initialized?



More information about the coin-dev mailing list