public IEnumerator <ElaValue> GetEnumerator() { ElaList xs = this; while (xs != Empty) { yield return(xs.InternalValue); var tl = xs.Tail().Ref; xs = tl as ElaList; if (xs == null) { throw InvalidDefinition(); } } }
internal int GetLength() { ElaList xs = this; var count = 0; while (xs != Empty) { count++; var tl = xs.Tail().Ref; xs = tl as ElaList; if (xs == null) { throw InvalidDefinition(); } } return(count); }