public static List FromVector(object[] vec) { List x = Null.NULL; for (int i = vec.Length - 1; i >= 0; i--) { x = new Pair(vec[i], x); } return x; }
public virtual void Reset() { current = null; }
public virtual bool MoveNext() { if (current == null) { current = start; return true; } else { object next = current.Cdr; if (next != Null.NULL) { if (next is Pair) { current = (Pair) next; return true; } else { throw new InvalidOperationException("Attempt to enumerate a Pair that is not a list"); } } else { return false; } } }
public PairEnumerator(Pair start) { this.start = start; this.current = null; }