def search_local(name)
      if variable = variables[name]
        return variable.nested_reference
      end

      if variable = search_scopes(name)
        variables[name] = variable
        return variable.nested_reference
      end
    end
def search_local(name)
      if variable = variables[name]
        return variable.nested_reference
      end

      if variable = search_scopes(name)
        variables[name] = variable
        return variable.nested_reference
      end
    end
Returns a cached reference to a variable or searches all
 surrounding scopes for a variable. If no variable is found,
 it returns nil and a nested scope will create the variable
 in itself.