Beispiel #1
0
        public MyEnvironment ancestor(int distance)
        {
            MyEnvironment environment = this;

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

            return(environment);
        }
Beispiel #2
0
 public MyEnvironment(MyEnvironment enclosing)
 {
     this.enclosing = enclosing;
 }
Beispiel #3
0
 public MyEnvironment()
 {
     enclosing = null;
 }