示例#1
0
 public bool MoveNext()
 {
     if (m_rest == null)
     {
         m_rest = m_list;
     }
     if (m_rest.Count > 0)
     {
         m_item = m_rest.First;
         m_rest = m_rest.Rest;
         return(true);
     }
     return(false);
 }
示例#2
0
        internal FunctionalList <T> Reverse()
        {
            FunctionalList <T> functionalList = Empty;

            using (IEnumerator <T> enumerator = GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    T current = enumerator.Current;
                    functionalList = functionalList.Add(current);
                }
                return(functionalList);
            }
        }
示例#3
0
 private FunctionalList(T aItem, FunctionalList <T> aCdr)
 {
     m_car  = aItem;
     m_cdr  = aCdr;
     m_size = aCdr.Count + 1;
 }
示例#4
0
 public void Reset()
 {
     m_rest = null;
 }
示例#5
0
 public FunctionalListEnumerator(FunctionalList <T> aList)
 {
     m_list = aList;
 }