public virtual int AssignArray(Runtime runtime, IP5Value other) { // FIXME multiple dispatch P5Array a = other as P5Array; P5Hash h = other as P5Hash; iterator = null; if (a != null) { AssignIterator(runtime, a.GetEnumerator(runtime)); return a.GetCount(runtime); } else if (h != null) { hash.Clear(); foreach (var e in h.hash) hash[e.Key] = e.Value.Clone(runtime, 0); return h.GetCount(runtime) * 2; } return 0; }
public override int AssignArray(Runtime runtime, IP5Value other) { // FIXME multiple dispatch P5Scalar s = other as P5Scalar; P5Array a = other as P5Array; IEnumerator<IP5Any> e = null; int c = 0; if (s != null) { e = s.GetEnumerator(runtime); c = 1; } else if (a != null) { e = a.GetEnumerator(runtime); c = a.GetCount(runtime); } foreach (var i in array) i.AssignIterator(runtime, e); return c; }
public void PushFlatten(Runtime runtime, IP5Value value) { throw new System.NotImplementedException(); }