From fee124a41964623dc902464bcbefecd130861eb3 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 20 Jan 2011 20:49:03 +0000 Subject: 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. --- test/files/run/transform.scala | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/files/run/transform.scala (limited to 'test/files/run/transform.scala') 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) + } +} -- cgit v1.2.3