diff options
author | Matthias Zenger <mzenger@gmail.com> | 2003-08-15 11:06:05 +0000 |
---|---|---|
committer | Matthias Zenger <mzenger@gmail.com> | 2003-08-15 11:06:05 +0000 |
commit | 4678d29bef64defbae69e10373f4bad6bf9a2adc (patch) | |
tree | 310c8020564a2f2dd854e78f5b1f9545a379c40e /sources | |
parent | 260757086149e48d2dbe955335ba959e874a6452 (diff) | |
download | scala-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.scala | 2 |
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 = |