summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorMatthias Zenger <mzenger@gmail.com>2003-08-15 11:06:05 +0000
committerMatthias Zenger <mzenger@gmail.com>2003-08-15 11:06:05 +0000
commit4678d29bef64defbae69e10373f4bad6bf9a2adc (patch)
tree310c8020564a2f2dd854e78f5b1f9545a379c40e /sources
parent260757086149e48d2dbe955335ba959e874a6452 (diff)
downloadscala-4678d29bef64defbae69e10373f4bad6bf9a2adc.tar.gz
scala-4678d29bef64defbae69e10373f4bad6bf9a2adc.tar.bz2
scala-4678d29bef64defbae69e10373f4bad6bf9a2adc.zip
Added a new function for quickly creating itera...
Added a new function for quickly creating iterators over statically fixed sequences of elements.
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/Iterator.scala2
1 files changed, 2 insertions, 0 deletions
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 =