def trim(n)
      result = self
      while n > 0 && !result.empty?
        result = result.tail
        n -= 1
      end
      result
    end
def trim(n)
      result = self
      while n > 0 && !result.empty?
        result = result.tail
        n -= 1
      end
      result
    end
Trim +n+ innermost scope levels from the scope. In no case will
 this trim beyond the toplevel scope.