Proposal keyword 'outer'

Bruno Medeiros brunodomedeirosATgmail at SPAM.com
Fri Jun 23 09:18:19 PDT 2006


Frank Benoit wrote:
> 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.

Seems an ok proposal for outer classes.
But as for mixins that doesn't make sense, the scope they access is 
already the scope of the instantiation.



-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list