summaryrefslogtreecommitdiff
path: root/test/files/run/transform.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-20 20:49:03 +0000
committerPaul Phillips <paulp@improving.org>2011-01-20 20:49:03 +0000
commitfee124a41964623dc902464bcbefecd130861eb3 (patch)
treefff42ac6bad8dc4a5b8a614ec0800d7e85fba497 /test/files/run/transform.scala
parent5c7ff3ea5faffae7a61b136ffcdd5e0fe25f9050 (diff)
downloadscala-fee124a41964623dc902464bcbefecd130861eb3.tar.gz
scala-fee124a41964623dc902464bcbefecd130861eb3.tar.bz2
scala-fee124a41964623dc902464bcbefecd130861eb3.zip
Integrated contributed non-recursive implementa...
Integrated contributed non-recursive implementation of permutations, combinations, subsets, by EastSun. Also gave mutable Seqs an in-place transform method like the one Map has. And couldn't resist slightly reformulating a few set methods, because how can we settle for "forall(that.contains)" when we could have "this forall that". (Which is also what normal people hear when we talk about sets.) Closes #4060, #3644, review by moors.
Diffstat (limited to 'test/files/run/transform.scala')
-rw-r--r--test/files/run/transform.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/files/run/transform.scala b/test/files/run/transform.scala
new file mode 100644
index 0000000000..250df95df0
--- /dev/null
+++ b/test/files/run/transform.scala
@@ -0,0 +1,8 @@
+object Test {
+ val x = 1 to 10 toBuffer
+
+ def main(args: Array[String]): Unit = {
+ x transform (_ * 2)
+ assert(x.sum == (1 to 10).sum * 2)
+ }
+}