Beispiel #1
0
        public override IESObject Execute(ESDomain domain)
        {
            var ret   = ESDefault.Value;
            var items = _list.GetValue <IESEnumerable>(domain);
            var iter  = items.GetEnumerator();

            while (true)
            {
                if (iter.MoveNext())
                {
                    var current = ToVirtual(iter.Current);
                    domain.AddValue(_index.Name, current);
                    ret = _entry.Invoke(domain, new[] { current });
                }
                else
                {
                    return(ret);
                }
            }
        }
Beispiel #2
0
        public override IESObject Execute(ESDomain domain)
        {
            var ret   = ESDefault.Value;
            var index = _begin.GetValue(domain).Clone().Cast <IESNumber>();
            var end   = _end.GetValue <IESNumber>(domain).Value;
            var step  = _step.GetValue <IESNumber>(domain).Value;

            while (true)
            {
                if (index.Value < end)
                {
                    domain.AddValue(_index.Name, index);
                    ret          = _entry.Invoke(domain, new IESObject[] { index });
                    index.Value += step;
                }
                else
                {
                    return(ret);
                }
            }
        }
Beispiel #3
0
 public IESObject Invoke(IESObject[] args)
 {
     return(_value.Invoke(_domain, args));
 }