Mixin Aspect-Orientation: Comments please!

Ary Borenszweig ary at esperanto.org.ar
Mon Jan 17 04:48:29 PST 2011


Say you have this:

class Bar {
  int foo() { ... }
}

And you have your aspect-oriented mixin:

mixin template Aspect {
  int foo() { ... }
}

and you want to change foo's behaviour. You can't change Bar's
source code. How can you change Bar#foo's behaviour like that? At
least you have to put the "mixin Aspect!" somewhere. So that means
this approach for aspect oriented features doesn't work.

What I realized some days ago is that many people here (including me
:-P) try to get or have features from other languages, mostly
dynamic or "cool" languages, but that won't work here since
everything is statically compiled and determined once you compile
your code. So you can't later "inject" new funcionality, you can't
modify the funcionality of what it is compiled.


More information about the Digitalmars-d mailing list