text: public override Ref Put(string keyName, Ref value){string name = ToRefName(keyName);if (!name.Equals(value.GetName())){throw new ArgumentException();}if (!resolved.IsEmpty()){foreach (Ref @ref in resolved){loose = loose.Put(@ref);}resolved = RefList.EmptyList();}int idx = loose.Find(name);if (0 <= idx){Ref prior = loose.Get(name);loose = loose.Set(idx, value);return prior;}else{Ref prior = Get(keyName);loose = loose.Add(idx, value);sizeIsValid = false;return prior;}}