Exemple #1
0
        /// <summary>
        /// interate through range.
        /// </summary>
        /// <returns> tail </returns>
        public override IEnumerator <Item> iterator()
        {
            // XXX life is getting hard...
            if (_size != 0)
            {
                ResultSequence newtail = ResultSequenceFactory.create_new();

                for (; _start <= _end; _start++)
                {
                    newtail.add(new XSInteger(new System.Numerics.BigInteger(_start)));
                }

                newtail.concat(_tail);
                _tail.release();
                _tail = newtail;

                _size  = 0;
                _start = 0;
                _end   = 0;
            }

            return(_tail.iterator());
        }