code: func ValueToInterface(v Value, resolver Resolver) (interface{}, error) {
  	switch v := v.(type) {
  	case Null:
  		return nil, nil
  	case Boolean:
  		return bool(v), nil
  	case Number:
  		return json.Number(v), nil
  	case String:
  		return string(v), nil
  	case Array:
  		buf := []interface{}{}
  		for _, x := range v {
  			x1, err := ValueToInterface(x.Value, resolver)
  			if err != nil {
  				return nil, err
  			}
  			buf = append(buf, x1)
  		}
  		return buf, nil
  	case Object:
  		buf := map[string]interface{}{}
  		err := v.Iter(func(k, v *Term) error {
  			ki, err := ValueToInterface(k.Value, resolver)
  			if err != nil {
  				return err
  			}
  			asStr, stringKey := ki.(string)
  			if !stringKey {
  				return fmt.Errorf("object value has non-string key (%T)", ki)
  			}
  			vi, err := ValueToInterface(v.Value, resolver)
  			if err != nil {
  				return err
  			}
  			buf[asStr] = vi
  			return nil
  		})
  		if err != nil {
  			return nil, err
  		}
  		return buf, nil
  	case Set:
  		buf := []interface{}{}
  		err := v.Iter(func(x *Term) error {
  			x1, err := ValueToInterface(x.Value, resolver)
  			if err != nil {
  				return err
  			}
  			buf = append(buf, x1)
  			return nil
  		})
  		if err != nil {
  			return nil, err
  		}
  		return buf, nil
  	case Ref:
  		return resolver.Resolve(v)
  	default:
  		return nil, fmt.Errorf("%v requires evaluation", TypeName(v))
  	}
  }
docs: // ValueToInterface returns the Go representation of an AST value.  The AST
  // value should not contain any values that require evaluation (e.g., vars,
  // comprehensions, etc.)