Ejemplo n.º 1
0
        public MyEnvironment ancestor(int distance)
        {
            MyEnvironment environment = this;

            for (int i = 0; i < distance; i++)
            {
                environment = environment.enclosing;
            }

            return(environment);
        }
Ejemplo n.º 2
0
 public MyEnvironment(MyEnvironment enclosing)
 {
     this.enclosing = enclosing;
 }
Ejemplo n.º 3
0
 public MyEnvironment()
 {
     enclosing = null;
 }