Created
July 17, 2012 00:53
-
-
Save davidandrzej/3126218 to your computer and use it in GitHub Desktop.
Map over a Strict Range
This file contains hidden or 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
| scala> val mutant = collection.mutable.ListBuffer[Int]() | |
| mutant: scala.collection.mutable.ListBuffer[Int] = ListBuffer() | |
| scala> (0 until 4).map{idx => { | |
| mutant.append(idx); idx > 0}}.exists(identity) | |
| res0: Boolean = true | |
| scala> mutant | |
| res1: scala.collection.mutable.ListBuffer[Int] = | |
| ListBuffer(0, 1, 2, 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment