Proposal keyword 'outer'

Frank Benoit keinfarbton at nospam.xyz
Tue Jun 20 03:03:56 PDT 2006


For inner classes and mixins, it would be good to have a reference to
the next outer scope.

class C{
 int i; // 1
 class C1{
  int i; // 2
  void func( int a ){
   i = a; // assign to 2
   outer.i = a; // assign to 1
  }
 }
}

In case of a mixin, outer is the scope of the instantiation.

outer can be chained like outer.outer.func() to go out in scope two levels.



More information about the Digitalmars-d mailing list