-
-
Save mmlac/fb5e850b17ebdd2d94bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val primes : Stream[Int] = 2 #:: Stream.from(3).filter(i => primes.takeWhile(k => k * k <= i).forall(k => i % k > 0)) | |
println(primes.take(10).toList) | |
//Error:(13, 65) forward reference extends over definition of value primes | |
// val primes : Stream[Int] = 2 #:: Stream.from(3).filter(i => primes.takeWhile(k => k * k <= i).forall(k => i % k > 0)) | |
// ^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment