From 4678d29bef64defbae69e10373f4bad6bf9a2adc Mon Sep 17 00:00:00 2001 From: Matthias Zenger Date: Fri, 15 Aug 2003 11:06:05 +0000 Subject: Added a new function for quickly creating itera... Added a new function for quickly creating iterators over statically fixed sequences of elements. --- sources/scala/Iterator.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/scala/Iterator.scala b/sources/scala/Iterator.scala index 58b2c399fa..1d5e505ee7 100644 --- a/sources/scala/Iterator.scala +++ b/sources/scala/Iterator.scala @@ -23,6 +23,8 @@ object Iterator { def next: a = error("next on empty iterator"); } + def fromSeq[a](xs: a*) = xs.elements; + def fromArray[a](xs: Array[a]) = new Iterator[a] { private var i = 0; def hasNext: Boolean = -- cgit v1.2.3