code: func (ref Ref) ConstantPrefix() Ref {
  	ref = ref.Copy()
  
  	i := ref.Dynamic()
  	if i < 0 {
  		return ref
  	}
  	return ref[:i]
  }
docs: // ConstantPrefix returns the constant portion of the ref starting from the head.