Пример #1
0
        public FunctionalList <T> Reverse()
        {
            FunctionalList <T> functionalList = FunctionalList <T> .Empty;

            foreach (T item in this)
            {
                functionalList = functionalList.Add(item);
            }
            return(functionalList);
        }
Пример #2
0
 public bool MoveNext()
 {
     if (this.m_rest == null)
     {
         this.m_rest = this.m_list;
     }
     if (this.m_rest.Count > 0)
     {
         this.m_item = this.m_rest.First;
         this.m_rest = this.m_rest.Rest;
         return(true);
     }
     return(false);
 }
Пример #3
0
 public void Reset()
 {
     this.m_rest = null;
 }
Пример #4
0
 public FunctionalListEnumerator(FunctionalList <T> aList)
 {
     this.m_list = aList;
 }
Пример #5
0
 private FunctionalList(T aItem, FunctionalList <T> aCdr)
 {
     this.m_car  = aItem;
     this.m_cdr  = aCdr;
     this.m_size = aCdr.Count + 1;
 }