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