Also what about something like adhoc interfaces?

// declare a interface, which contains the method m1
adhoc interface HasM1 {
  public int m1 ( int p1, String p2);
}

// use the interface HasM1 as parameter type
class C {
  public void test( HasM1 x){
      int xResult = x.m1( 1, "hello");
  }     
}

// a class which "implements" the adhoc interface doesn't need to know 
// about the interface, it only has to conform to it.
class A {
  public int m1 ( int p1, String p2){
     //...
  }
}

// another class which "implements" the adhoc interface
class B {
  public int m1 ( int p1, String p2){
     //...
  }
}

Instances of both of the classes A and B could be used as parameter to 
C.test. I think, this could be useful if you have to work with third 
party libraries. It helps to avoid a lot of adapter code.

Cheers,
Ralf.


Nicolas Cannasse wrote:
> Hi folks,
> 
> The new still-unamed language specifications have been updated at
> http://ncannasse.free.fr/files/flexible.html . It now includes enumerators,
> Dynamic type parameters and a beginning of grammar rules.
> 
> I would like to get comments about the design of the language : what are the
> features you've been dreaming about ? How should look for you the language
> you'll be happy to write in everyday at work ?
> 
> It's an open discussion, so bring  your ideas in . I have my own ones, but I
> think opening the design to everybody will result in a better result in the
> end.
> 
> Have fun !
> 
> Nicolas
> 
> 
> _______________________________________________
> osflash mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/osflash_osflash.org

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to