language: Scala (scala-2.10.0)
date: 92 days 0 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
object Main extends App {
//=========================
 
def longRange(start: Long, to: Long) = new Iterator[Long] {
    private var i = start
    def hasNext = {
        i < to
    }
    def next() = {
        val r = i
        i += 1
        r
    }
}
 
val lol = longRange(0, Long.MaxValue) map (x => x * x)
 
lol drop 5 take 5 foreach println
 
//=========================
}
Main.scala:7: error: overloaded method value < with alternatives:
  (x: Double)Boolean <and>
  (x: Float)Boolean <and>
  (x: Long)Boolean <and>
  (x: Int)Boolean <and>
  (x: Char)Boolean <and>
  (x: Short)Boolean <and>
  (x: Byte)Boolean
 cannot be applied to (scala.collection.immutable.IndexedSeq[Long])
        i < to
          ^
one error found
spoj: The program compiled successfully, but Main.class was not found.
      Class Main should contain method: def main(args: Array[String]).