def lookup_variable(var, prefix=nil)

      var, prefix = split_prefix(var, prefix)

      if prefix == '//'
        return @context.storage.get_engine_variable(var)
      end

      if prefix == '/' && par = parent
        return par.lookup_variable(var, prefix)
      end

      if h.variables and Ruote.has_key?(h.variables, var)
        return Ruote.lookup(h.variables, var)
      end

      if h.parent_id && h.parent_id['engine_id'] == @context.engine_id
        #
        # do not lookup variables in a remote engine ...

        (return parent.lookup_variable(var, prefix)) rescue nil
          # if the lookup fails (parent gone) then rescue and let go
      end

      k = var.split('.').first
      vars = { k => @context.storage.get_engine_variable(k) }
        #
        # engine var lookup might be expensive, only lookup the var we need

      Ruote.lookup(vars, var)
    end
def lookup_variable(var, prefix=nil)

      var, prefix = split_prefix(var, prefix)

      if prefix == '//'
        return @context.storage.get_engine_variable(var)
      end

      if prefix == '/' && par = parent
        return par.lookup_variable(var, prefix)
      end

      if h.variables and Ruote.has_key?(h.variables, var)
        return Ruote.lookup(h.variables, var)
      end

      if h.parent_id && h.parent_id['engine_id'] == @context.engine_id
        #
        # do not lookup variables in a remote engine ...

        (return parent.lookup_variable(var, prefix)) rescue nil
          # if the lookup fails (parent gone) then rescue and let go
      end

      k = var.split('.').first
      vars = { k => @context.storage.get_engine_variable(k) }
        #
        # engine var lookup might be expensive, only lookup the var we need

      Ruote.lookup(vars, var)
    end
Looks up the value of a variable in expression tree
 (seen from a leaf, it looks more like a stack than a tree)