public FunctionalList <T> Reverse() { FunctionalList <T> functionalList = FunctionalList <T> .Empty; foreach (T item in this) { functionalList = functionalList.Add(item); } return(functionalList); }
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); }
public void Reset() { this.m_rest = null; }
public FunctionalListEnumerator(FunctionalList <T> aList) { this.m_list = aList; }
private FunctionalList(T aItem, FunctionalList <T> aCdr) { this.m_car = aItem; this.m_cdr = aCdr; this.m_size = aCdr.Count + 1; }