Skip to content

Instantly share code, notes, and snippets.

@mmlac
Created December 8, 2014 02:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmlac/fb5e850b17ebdd2d94bc to your computer and use it in GitHub Desktop.
Save mmlac/fb5e850b17ebdd2d94bc to your computer and use it in GitHub Desktop.
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