Example #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);
 }
Example #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);
            }
        }
Example #3
0
 private FunctionalList(T aItem, FunctionalList <T> aCdr)
 {
     m_car  = aItem;
     m_cdr  = aCdr;
     m_size = aCdr.Count + 1;
 }
Example #4
0
 public void Reset()
 {
     m_rest = null;
 }
Example #5
0
 public FunctionalListEnumerator(FunctionalList <T> aList)
 {
     m_list = aList;
 }