Beispiel #1
0
        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;
        }
Beispiel #2
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;
        }
Beispiel #3
0
 public void PushFlatten(Runtime runtime, IP5Value value)
 {
     throw new System.NotImplementedException();
 }