Skip to content

Instantly share code, notes, and snippets.

@oxbowlakes
Created January 13, 2016 20:45
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 oxbowlakes/956164ac429eddcfb9ad to your computer and use it in GitHub Desktop.
Save oxbowlakes/956164ac429eddcfb9ad to your computer and use it in GitHub Desktop.
scala> val it = Traversable(1); it foreach (i => println(s"$i and ${it.isEmpty}"))
1 and false
scala> val it = Iterator(1); it foreach (i => println(s"$i and ${it.isEmpty}"))
1 and true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment