mixins java extension

Hi,

I 'd like to add a root-level java extension for mixins (= abstract subclass). So, my syntax will be something like:
Code
mixin MyMixin<SuperClass> {
  int myfield;
  void method1() {
    myfield++'
    SuperClass.method1();
  }
}


Is there any similar example i could look at (most of the examples i have seen about mps' java extensions are about simple non-root constructs like 'unless' or 'ranges')? Would it be helpful to check e.g. baseLanguage's interface implementation?
Any other tip/help would be much appreciated.

Thank you,
George.
0
5 comments
Avatar
Permanently deleted user
Hi, George,

Yes sure, take a look on jetbrains.mps.baseLanguage.extension it makes just the same things.
0
Avatar
Permanently deleted user
Thanks for the quick reply.
What do you mean by jetbrains.mps.baseLanguage.extension? The baseLanguage's extensions like closures, collections, dates etc? If yes, then AFAIK all these extension are not root-level.
0
Avatar
Permanently deleted user
No I meant exactly "jetbrains.mps.baseLanguage.extensionMethods" language, which adds support of mixins to baseLanguage called in those language "Extension". It can add methods to classes, but not fields. If you create a language which extend class with your custom fields it would be cool. =)
0
Avatar
Permanently deleted user
Anyway, you can get nice ideas from that language.
Good luck!
0
Avatar
Permanently deleted user
Oh cool! Thanks a lot.
0

Please sign in to leave a comment.