diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-09 11:06:22 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-09 17:11:05 -0800 |
commit | e55510607031aaf7b8473453f83c44a26c9b97e0 (patch) | |
tree | 987d4aeeef387ed435acc64ffadfdf78e6f65bce /docs/examples/iterators.scala | |
parent | dc6dd58d9da441b591580684f3d2f38d7898e7d4 (diff) | |
download | scala-e55510607031aaf7b8473453f83c44a26c9b97e0.tar.gz scala-e55510607031aaf7b8473453f83c44a26c9b97e0.tar.bz2 scala-e55510607031aaf7b8473453f83c44a26c9b97e0.zip |
Remove docs/examples; they reside at scala/scala-dist
Diffstat (limited to 'docs/examples/iterators.scala')
-rw-r--r-- | docs/examples/iterators.scala | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/docs/examples/iterators.scala b/docs/examples/iterators.scala deleted file mode 100644 index e2e5e050a0..0000000000 --- a/docs/examples/iterators.scala +++ /dev/null @@ -1,28 +0,0 @@ -package examples - -object iterators { - - def Array(elems: Double*): Array[Double] = { - val ar = new Array[Double](elems.length) - for (i <- 0 until elems.length) - ar(i) = elems(i) - ar - } - - def printArray(xs: Array[Double]) = - xs.iterator foreach { x => println(x) } - - def findGreater(xs: Array[Double], limit: Double) = - xs.iterator - .zip(Iterator.from(0)) - .filter{case Pair(x, i) => x > limit } - .map{case Pair(x, i) => i} - - def main(args: Array[String]) { - val ar = Array/*[Double]*/(6, 2, 8, 5, 1) - printArray(ar) - println("Elements greater than 3.0:") - findGreater(ar, 3.0) foreach { x => Console.println(ar(x)) } - } - -} |