diff options
author | Antonio Cunei <antonio.cunei@epfl.ch> | 2010-01-18 16:45:48 +0000 |
---|---|---|
committer | Antonio Cunei <antonio.cunei@epfl.ch> | 2010-01-18 16:45:48 +0000 |
commit | 2cff99f2d2cff5a3e1b896177abbd2acda239744 (patch) | |
tree | 4e553e0c7d9d63dd6d8ecedaa8be51144db4308c /src/library | |
parent | 7aa371b39388bc510e9cd3f081b2019b09da0a63 (diff) | |
download | scala-2cff99f2d2cff5a3e1b896177abbd2acda239744.tar.gz scala-2cff99f2d2cff5a3e1b896177abbd2acda239744.tar.bz2 scala-2cff99f2d2cff5a3e1b896177abbd2acda239744.zip |
Merged revisions 20538-20539,20543-20544,20549,...
Merged revisions
20538-20539,20543-20544,20549,20555-20556,20559-20562,20564-20566 via
svnmerge from https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk
........
r20538 | extempore | 2010-01-15 19:00:51 +0100 (Fri, 15 Jan 2010) | 11 lines
Fix for #2365. Structural type mono and poly caches now wrap a soft
reference around cached classes so they do not interfere with garbage
collection. There is a test case, but it is in pending because I spent
longer trying to get it to fail under partest than I did writing
the actual patch. If you would like to see the behavior which was
corrected, go to
test/pending/run/bug2365
and run that script with scalac built before and after this commit.
Review by dubochet. ........ r20539 | extempore | 2010-01-15 20:48:57
+0100 (Fri, 15 Jan 2010) | 2 lines
Wrapped a buffered output stream around class file generation. This
has a nontrivial impact on total build time. Closes #2906. ........
r20543 | extempore | 2010-01-16 04:54:39 +0100 (Sat, 16 Jan 2010) | 2
lines
Exposed native Array clone() method. Closes #1051. Review by dragos.
........ r20544 | extempore | 2010-01-16 07:37:37 +0100 (Sat, 16 Jan
2010) | 2 lines
Made Iterator consistent with Iterable by adding grouped and sliding
to IterableLike. Closes #2837. Review by community. ........ r20549 |
extempore | 2010-01-16 22:52:44 +0100 (Sat, 16 Jan 2010) | 8 lines
New repl feature: you can start a line with . to invoke actions on the
previous result. For instance:
scala> (1 to 10).iterator
res0: Iterator[Int] = non-empty iterator
scala> .toList.sum
res1: Int = 55
........
r20555 | extempore | 2010-01-17 20:07:38 +0100 (Sun, 17 Jan 2010) | 2 lines
Brought ShowPickler somewhat more up to date with the current pickler
format. ........ r20556 | extempore | 2010-01-17 21:50:47 +0100 (Sun, 17
Jan 2010) | 2 lines
Don't insert whitespace on multiline strings and xml literals. Closes
#2115. No review. ........ r20559 | extempore | 2010-01-18 05:14:06
+0100 (Mon, 18 Jan 2010) | 1 line
Test case closes #1737. Review by community.
........
r20560 | extempore | 2010-01-18 05:14:25 +0100 (Mon, 18 Jan 2010) | 1 line
Fix and test case for #408. Review by community. ........ r20561 |
extempore | 2010-01-18 06:02:30 +0100 (Mon, 18 Jan 2010) | 4 lines
Adjectified some parts of speech as discussed on the mailing list. The
methods to call on FunctionN are "curried" and "tupled" with "curry"
deprecated and "tuple" gone. Closes #2907. Review by community. ........
r20562 | milessabin | 2010-01-18 13:20:57 +0100 (Mon, 18 Jan 2010) | 1
line
Fix and test case for #2891. No review necessary. ........ r20564 |
odersky | 2010-01-18 15:53:54 +0100 (Mon, 18 Jan 2010) | 1 line
cleaned up explicit tailcalls
........
r20565 | odersky | 2010-01-18 15:57:18 +0100 (Mon, 18 Jan 2010) | 1 line
some more performance tunings. No review.
........
r20566 | odersky | 2010-01-18 15:57:47 +0100 (Mon, 18 Jan 2010) | 1 line
new test. no review.
........
Diffstat (limited to 'src/library')
77 files changed, 362 insertions, 216 deletions
diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala index fd171c5a5e..afaaed7c7c 100644 --- a/src/library/scala/Array.scala +++ b/src/library/scala/Array.scala @@ -538,4 +538,12 @@ final class Array[T](_length: Int) { * <code>length <= i</code> */ def update(i: Int, x: T) { throw new Error() } + + /** <p> + * Clone the Array. + * </p> + * + * @return A clone of the Array. + */ + override def clone: Array[T] = throw new Error() } diff --git a/src/library/scala/Function.scala b/src/library/scala/Function.scala index 2c9772c526..0409d938fd 100644 --- a/src/library/scala/Function.scala +++ b/src/library/scala/Function.scala @@ -36,7 +36,7 @@ object Function * @param f ... * @return ... */ - @deprecated("Use `f.curry` instead") + @deprecated("Use `f.curried` instead") def curried[a1, a2, b](f: (a1, a2) => b): a1 => a2 => b = { x1 => x2 => f(x1, x2) } @@ -46,21 +46,21 @@ object Function * @param f ... * @return ... */ - @deprecated("Use `f.curry` instead") + @deprecated("Use `f.curried` instead") def curried[a1, a2, a3, b](f: (a1, a2, a3) => b): a1 => a2 => a3 => b = { x1 => x2 => x3 => f(x1, x2, x3) } /** Currying for functions of arity 4. */ - @deprecated("Use `f.curry` instead") + @deprecated("Use `f.curried` instead") def curried[a1, a2, a3, a4, b](f: (a1, a2, a3, a4) => b): a1 => a2 => a3 => a4 => b = { x1 => x2 => x3 => x4 => f(x1, x2, x3, x4) } /** Currying for functions of arity 5. */ - @deprecated("Use `f.curry` instead") + @deprecated("Use `f.curried` instead") def curried[a1, a2, a3, a4, a5, b](f: (a1, a2, a3, a4, a5) => b): a1 => a2 => a3 => a4 => a5 => b = { x1 => x2 => x3 => x4 => x5 => f(x1, x2, x3, x4, x5) } @@ -96,7 +96,7 @@ object Function * @param f ... * @return ... */ - @deprecated("Use `f.tuple` instead") + @deprecated("Use `f.tupled` instead") def tupled[a1, a2, b](f: (a1, a2) => b): Tuple2[a1, a2] => b = { case Tuple2(x1, x2) => f(x1, x2) } @@ -104,7 +104,7 @@ object Function /** Tupling for functions of arity 3. This transforms a function * of arity 3 into a unary function that takes a triple of arguments. */ - @deprecated("Use `f.tuple` instead") + @deprecated("Use `f.tupled` instead") def tupled[a1, a2, a3, b](f: (a1, a2, a3) => b): Tuple3[a1, a2, a3] => b = { case Tuple3(x1, x2, x3) => f(x1, x2, x3) } @@ -112,7 +112,7 @@ object Function /** Tupling for functions of arity 4. This transforms a function * of arity 4 into a unary function that takes a 4-tuple of arguments. */ - @deprecated("Use `f.tuple` instead") + @deprecated("Use `f.tupled` instead") def tupled[a1, a2, a3, a4, b](f: (a1, a2, a3, a4) => b): Tuple4[a1, a2, a3, a4] => b = { case Tuple4(x1, x2, x3, x4) => f(x1, x2, x3, x4) } @@ -120,7 +120,7 @@ object Function /** Tupling for functions of arity 5. This transforms a function * of arity 5 into a unary function that takes a 5-tuple of arguments. */ - @deprecated("Use `f.tuple` instead") + @deprecated("Use `f.tupled` instead") def tupled[a1, a2, a3, a4, a5, b](f: (a1, a2, a3, a4, a5) => b): Tuple5[a1, a2, a3, a4, a5] => b = { case Tuple5(x1, x2, x3, x4, x5) => f(x1, x2, x3, x4, x5) } diff --git a/src/library/scala/Function0.scala b/src/library/scala/Function0.scala index 27450789e2..74905d8af7 100644 --- a/src/library/scala/Function0.scala +++ b/src/library/scala/Function0.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with fancy comment) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with fancy comment) package scala diff --git a/src/library/scala/Function1.scala b/src/library/scala/Function1.scala index 4856891acf..75110d7d4e 100644 --- a/src/library/scala/Function1.scala +++ b/src/library/scala/Function1.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with fancy comment) (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with fancy comment) (with extra methods) package scala diff --git a/src/library/scala/Function10.scala b/src/library/scala/Function10.scala index 7e0e3dac09..8eb6fad84e 100644 --- a/src/library/scala/Function10.scala +++ b/src/library/scala/Function10.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function10[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, +R] extends def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10): R override def toString() = "<function10>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) == (f.tuple)(Tuple10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) == (f.tupled)(Tuple10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)) */ - def tuple: Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10] => R = { + def tupled: Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10] => R = { case Tuple10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) } diff --git a/src/library/scala/Function11.scala b/src/library/scala/Function11.scala index 7877a30d24..7e94c6d2ca 100644 --- a/src/library/scala/Function11.scala +++ b/src/library/scala/Function11.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function11[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, +R] ex def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11): R override def toString() = "<function11>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) == (f.tuple)(Tuple11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) == (f.tupled)(Tuple11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)) */ - def tuple: Tuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11] => R = { + def tupled: Tuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11] => R = { case Tuple11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) } diff --git a/src/library/scala/Function12.scala b/src/library/scala/Function12.scala index 7bfc6b92f8..e14b95fc81 100644 --- a/src/library/scala/Function12.scala +++ b/src/library/scala/Function12.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function12[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12): R override def toString() = "<function12>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) == (f.tuple)(Tuple12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) == (f.tupled)(Tuple12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)) */ - def tuple: Tuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12] => R = { + def tupled: Tuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12] => R = { case Tuple12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) } diff --git a/src/library/scala/Function13.scala b/src/library/scala/Function13.scala index 18e29b5d13..2deeed8aa7 100644 --- a/src/library/scala/Function13.scala +++ b/src/library/scala/Function13.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function13[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13): R override def toString() = "<function13>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) == (f.tuple)(Tuple13(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) == (f.tupled)(Tuple13(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)) */ - def tuple: Tuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13] => R = { + def tupled: Tuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13] => R = { case Tuple13(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) } diff --git a/src/library/scala/Function14.scala b/src/library/scala/Function14.scala index 45bdeada72..596bbb25b8 100644 --- a/src/library/scala/Function14.scala +++ b/src/library/scala/Function14.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function14[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14): R override def toString() = "<function14>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) == (f.tuple)(Tuple14(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) == (f.tupled)(Tuple14(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)) */ - def tuple: Tuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14] => R = { + def tupled: Tuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14] => R = { case Tuple14(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) } diff --git a/src/library/scala/Function15.scala b/src/library/scala/Function15.scala index 8778224e02..9942ab2015 100644 --- a/src/library/scala/Function15.scala +++ b/src/library/scala/Function15.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function15[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15): R override def toString() = "<function15>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) == (f.tuple)(Tuple15(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) == (f.tupled)(Tuple15(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15)) */ - def tuple: Tuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15] => R = { + def tupled: Tuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15] => R = { case Tuple15(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) } diff --git a/src/library/scala/Function16.scala b/src/library/scala/Function16.scala index 81a3077136..5419b40f8d 100644 --- a/src/library/scala/Function16.scala +++ b/src/library/scala/Function16.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function16[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16): R override def toString() = "<function16>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) == (f.tuple)(Tuple16(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) == (f.tupled)(Tuple16(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)) */ - def tuple: Tuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16] => R = { + def tupled: Tuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16] => R = { case Tuple16(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) } diff --git a/src/library/scala/Function17.scala b/src/library/scala/Function17.scala index 42dfdf1c22..17caf47a02 100644 --- a/src/library/scala/Function17.scala +++ b/src/library/scala/Function17.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function17[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16,v17:T17): R override def toString() = "<function17>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) == (f.tuple)(Tuple17(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) == (f.tupled)(Tuple17(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)) */ - def tuple: Tuple17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17] => R = { + def tupled: Tuple17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17] => R = { case Tuple17(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) } diff --git a/src/library/scala/Function18.scala b/src/library/scala/Function18.scala index 91ea1849ff..338083ef17 100644 --- a/src/library/scala/Function18.scala +++ b/src/library/scala/Function18.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function18[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16,v17:T17,v18:T18): R override def toString() = "<function18>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) == (f.tuple)(Tuple18(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) == (f.tupled)(Tuple18(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)) */ - def tuple: Tuple18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18] => R = { + def tupled: Tuple18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18] => R = { case Tuple18(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) } diff --git a/src/library/scala/Function19.scala b/src/library/scala/Function19.scala index bbabac9c79..92eb2afa29 100644 --- a/src/library/scala/Function19.scala +++ b/src/library/scala/Function19.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function19[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16,v17:T17,v18:T18,v19:T19): R override def toString() = "<function19>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) == (f.tuple)(Tuple19(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) == (f.tupled)(Tuple19(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)) */ - def tuple: Tuple19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19] => R = { + def tupled: Tuple19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19] => R = { case Tuple19(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) } diff --git a/src/library/scala/Function2.scala b/src/library/scala/Function2.scala index 21cc69a766..99c4ed1d2a 100644 --- a/src/library/scala/Function2.scala +++ b/src/library/scala/Function2.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with fancy comment) (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with fancy comment) (with extra methods) package scala @@ -39,15 +39,17 @@ trait Function2[-T1, -T2, +R] extends AnyRef { self => def apply(v1:T1,v2:T2): R override def toString() = "<function2>" - /** f(x1, x2) == (f.curry)(x1)(x2) + /** f(x1, x2) == (f.curried)(x1)(x2) */ - def curry: T1 => T2 => R = { + def curried: T1 => T2 => R = { (x1: T1) => (x2: T2) => apply(x1, x2) } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2) == (f.tuple)(Tuple2(x1, x2)) + /* f(x1, x2) == (f.tupled)(Tuple2(x1, x2)) */ - def tuple: Tuple2[T1, T2] => R = { + def tupled: Tuple2[T1, T2] => R = { case Tuple2(x1, x2) => apply(x1, x2) } diff --git a/src/library/scala/Function20.scala b/src/library/scala/Function20.scala index fda6d54f23..45636a1b7d 100644 --- a/src/library/scala/Function20.scala +++ b/src/library/scala/Function20.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function20[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16,v17:T17,v18:T18,v19:T19,v20:T20): R override def toString() = "<function20>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19)(x20) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19)(x20) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => T20 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => T20 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) == (f.tuple)(Tuple20(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) == (f.tupled)(Tuple20(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20)) */ - def tuple: Tuple20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20] => R = { + def tupled: Tuple20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20] => R = { case Tuple20(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) } diff --git a/src/library/scala/Function21.scala b/src/library/scala/Function21.scala index 20d3582300..4463866a55 100644 --- a/src/library/scala/Function21.scala +++ b/src/library/scala/Function21.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function21[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16,v17:T17,v18:T18,v19:T19,v20:T20,v21:T21): R override def toString() = "<function21>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19)(x20)(x21) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19)(x20)(x21) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => T20 => T21 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20, x21: T21) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => T20 => T21 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20, x21: T21) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) == (f.tuple)(Tuple21(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) == (f.tupled)(Tuple21(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)) */ - def tuple: Tuple21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21] => R = { + def tupled: Tuple21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21] => R = { case Tuple21(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) } diff --git a/src/library/scala/Function22.scala b/src/library/scala/Function22.scala index 4dca9748cd..c148144ef4 100644 --- a/src/library/scala/Function22.scala +++ b/src/library/scala/Function22.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function22[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16,v17:T17,v18:T18,v19:T19,v20:T20,v21:T21,v22:T22): R override def toString() = "<function22>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19)(x20)(x21)(x22) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19)(x20)(x21)(x22) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => T20 => T21 => T22 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20, x21: T21, x22: T22) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => T20 => T21 => T22 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20, x21: T21, x22: T22) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) == (f.tuple)(Tuple22(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) == (f.tupled)(Tuple22(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)) */ - def tuple: Tuple22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22] => R = { + def tupled: Tuple22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22] => R = { case Tuple22(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) } diff --git a/src/library/scala/Function3.scala b/src/library/scala/Function3.scala index 5493716bd9..52c777fdc9 100644 --- a/src/library/scala/Function3.scala +++ b/src/library/scala/Function3.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function3[-T1, -T2, -T3, +R] extends AnyRef { self => def apply(v1:T1,v2:T2,v3:T3): R override def toString() = "<function3>" - /** f(x1, x2, x3) == (f.curry)(x1)(x2)(x3) + /** f(x1, x2, x3) == (f.curried)(x1)(x2)(x3) */ - def curry: T1 => T2 => T3 => R = { + def curried: T1 => T2 => T3 => R = { (x1: T1) => (x2: T2) => (x3: T3) => apply(x1, x2, x3) } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3) == (f.tuple)(Tuple3(x1, x2, x3)) + /* f(x1, x2, x3) == (f.tupled)(Tuple3(x1, x2, x3)) */ - def tuple: Tuple3[T1, T2, T3] => R = { + def tupled: Tuple3[T1, T2, T3] => R = { case Tuple3(x1, x2, x3) => apply(x1, x2, x3) } diff --git a/src/library/scala/Function4.scala b/src/library/scala/Function4.scala index fde16c8af8..79e92dc4e3 100644 --- a/src/library/scala/Function4.scala +++ b/src/library/scala/Function4.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function4[-T1, -T2, -T3, -T4, +R] extends AnyRef { self => def apply(v1:T1,v2:T2,v3:T3,v4:T4): R override def toString() = "<function4>" - /** f(x1, x2, x3, x4) == (f.curry)(x1)(x2)(x3)(x4) + /** f(x1, x2, x3, x4) == (f.curried)(x1)(x2)(x3)(x4) */ - def curry: T1 => T2 => T3 => T4 => R = { + def curried: T1 => T2 => T3 => T4 => R = { (x1: T1) => (x2: T2) => (x3: T3) => (x4: T4) => apply(x1, x2, x3, x4) } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4) == (f.tuple)(Tuple4(x1, x2, x3, x4)) + /* f(x1, x2, x3, x4) == (f.tupled)(Tuple4(x1, x2, x3, x4)) */ - def tuple: Tuple4[T1, T2, T3, T4] => R = { + def tupled: Tuple4[T1, T2, T3, T4] => R = { case Tuple4(x1, x2, x3, x4) => apply(x1, x2, x3, x4) } diff --git a/src/library/scala/Function5.scala b/src/library/scala/Function5.scala index 927cc7d942..af849300f4 100644 --- a/src/library/scala/Function5.scala +++ b/src/library/scala/Function5.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function5[-T1, -T2, -T3, -T4, -T5, +R] extends AnyRef { self => def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5): R override def toString() = "<function5>" - /** f(x1, x2, x3, x4, x5) == (f.curry)(x1)(x2)(x3)(x4)(x5) + /** f(x1, x2, x3, x4, x5) == (f.curried)(x1)(x2)(x3)(x4)(x5) */ - def curry: T1 => T2 => T3 => T4 => T5 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5) => self.apply(x1, x2, x3, x4, x5)).curry + def curried: T1 => T2 => T3 => T4 => T5 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5) => self.apply(x1, x2, x3, x4, x5)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5) == (f.tuple)(Tuple5(x1, x2, x3, x4, x5)) + /* f(x1, x2, x3, x4, x5) == (f.tupled)(Tuple5(x1, x2, x3, x4, x5)) */ - def tuple: Tuple5[T1, T2, T3, T4, T5] => R = { + def tupled: Tuple5[T1, T2, T3, T4, T5] => R = { case Tuple5(x1, x2, x3, x4, x5) => apply(x1, x2, x3, x4, x5) } diff --git a/src/library/scala/Function6.scala b/src/library/scala/Function6.scala index e2857647b0..487c650fc9 100644 --- a/src/library/scala/Function6.scala +++ b/src/library/scala/Function6.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function6[-T1, -T2, -T3, -T4, -T5, -T6, +R] extends AnyRef { self => def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6): R override def toString() = "<function6>" - /** f(x1, x2, x3, x4, x5, x6) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6) + /** f(x1, x2, x3, x4, x5, x6) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6) => self.apply(x1, x2, x3, x4, x5, x6)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6) => self.apply(x1, x2, x3, x4, x5, x6)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6) == (f.tuple)(Tuple6(x1, x2, x3, x4, x5, x6)) + /* f(x1, x2, x3, x4, x5, x6) == (f.tupled)(Tuple6(x1, x2, x3, x4, x5, x6)) */ - def tuple: Tuple6[T1, T2, T3, T4, T5, T6] => R = { + def tupled: Tuple6[T1, T2, T3, T4, T5, T6] => R = { case Tuple6(x1, x2, x3, x4, x5, x6) => apply(x1, x2, x3, x4, x5, x6) } diff --git a/src/library/scala/Function7.scala b/src/library/scala/Function7.scala index e3193f91b3..76de5c185c 100644 --- a/src/library/scala/Function7.scala +++ b/src/library/scala/Function7.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function7[-T1, -T2, -T3, -T4, -T5, -T6, -T7, +R] extends AnyRef { self => def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7): R override def toString() = "<function7>" - /** f(x1, x2, x3, x4, x5, x6, x7) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7) + /** f(x1, x2, x3, x4, x5, x6, x7) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7) => self.apply(x1, x2, x3, x4, x5, x6, x7)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7) => self.apply(x1, x2, x3, x4, x5, x6, x7)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7) == (f.tuple)(Tuple7(x1, x2, x3, x4, x5, x6, x7)) + /* f(x1, x2, x3, x4, x5, x6, x7) == (f.tupled)(Tuple7(x1, x2, x3, x4, x5, x6, x7)) */ - def tuple: Tuple7[T1, T2, T3, T4, T5, T6, T7] => R = { + def tupled: Tuple7[T1, T2, T3, T4, T5, T6, T7] => R = { case Tuple7(x1, x2, x3, x4, x5, x6, x7) => apply(x1, x2, x3, x4, x5, x6, x7) } diff --git a/src/library/scala/Function8.scala b/src/library/scala/Function8.scala index 3fb8ee458e..c8ca675365 100644 --- a/src/library/scala/Function8.scala +++ b/src/library/scala/Function8.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function8[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, +R] extends AnyRef { sel def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8): R override def toString() = "<function8>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8) + /** f(x1, x2, x3, x4, x5, x6, x7, x8) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8) == (f.tuple)(Tuple8(x1, x2, x3, x4, x5, x6, x7, x8)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8) == (f.tupled)(Tuple8(x1, x2, x3, x4, x5, x6, x7, x8)) */ - def tuple: Tuple8[T1, T2, T3, T4, T5, T6, T7, T8] => R = { + def tupled: Tuple8[T1, T2, T3, T4, T5, T6, T7, T8] => R = { case Tuple8(x1, x2, x3, x4, x5, x6, x7, x8) => apply(x1, x2, x3, x4, x5, x6, x7, x8) } diff --git a/src/library/scala/Function9.scala b/src/library/scala/Function9.scala index dc94f14348..338acbcae2 100644 --- a/src/library/scala/Function9.scala +++ b/src/library/scala/Function9.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -23,15 +23,17 @@ trait Function9[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, +R] extends AnyRef def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9): R override def toString() = "<function9>" - /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9) == (f.curried)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9) */ - def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9)).curry + def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => R = { + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9)).curried } + @deprecated("Use 'curried' instead") + def curry = curried - /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9) == (f.tuple)(Tuple9(x1, x2, x3, x4, x5, x6, x7, x8, x9)) + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9) == (f.tupled)(Tuple9(x1, x2, x3, x4, x5, x6, x7, x8, x9)) */ - def tuple: Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9] => R = { + def tupled: Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9] => R = { case Tuple9(x1, x2, x3, x4, x5, x6, x7, x8, x9) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9) } diff --git a/src/library/scala/Product1.scala b/src/library/scala/Product1.scala index 4387d4dd8a..2cca5fe7d5 100644 --- a/src/library/scala/Product1.scala +++ b/src/library/scala/Product1.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product10.scala b/src/library/scala/Product10.scala index e776d7a0c4..a63a1007fb 100644 --- a/src/library/scala/Product10.scala +++ b/src/library/scala/Product10.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product11.scala b/src/library/scala/Product11.scala index ff7e572ff2..a33df77b64 100644 --- a/src/library/scala/Product11.scala +++ b/src/library/scala/Product11.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product12.scala b/src/library/scala/Product12.scala index b41c185da1..24b16876a3 100644 --- a/src/library/scala/Product12.scala +++ b/src/library/scala/Product12.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product13.scala b/src/library/scala/Product13.scala index 707aec63d8..1013561af6 100644 --- a/src/library/scala/Product13.scala +++ b/src/library/scala/Product13.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product14.scala b/src/library/scala/Product14.scala index 6e29529637..ddeccf7c98 100644 --- a/src/library/scala/Product14.scala +++ b/src/library/scala/Product14.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product15.scala b/src/library/scala/Product15.scala index f38432f6e9..0f25bda254 100644 --- a/src/library/scala/Product15.scala +++ b/src/library/scala/Product15.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product16.scala b/src/library/scala/Product16.scala index ff1477c509..1fcf2d192b 100644 --- a/src/library/scala/Product16.scala +++ b/src/library/scala/Product16.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product17.scala b/src/library/scala/Product17.scala index e5334cdf95..8c5efa9cc5 100644 --- a/src/library/scala/Product17.scala +++ b/src/library/scala/Product17.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product18.scala b/src/library/scala/Product18.scala index dbbdb81368..6ab150b1d1 100644 --- a/src/library/scala/Product18.scala +++ b/src/library/scala/Product18.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product19.scala b/src/library/scala/Product19.scala index c712fc6566..86fc2e43fb 100644 --- a/src/library/scala/Product19.scala +++ b/src/library/scala/Product19.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product2.scala b/src/library/scala/Product2.scala index 0b2751e3bc..27580f8658 100644 --- a/src/library/scala/Product2.scala +++ b/src/library/scala/Product2.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product20.scala b/src/library/scala/Product20.scala index 20f7ce7186..cc398f7bb4 100644 --- a/src/library/scala/Product20.scala +++ b/src/library/scala/Product20.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product21.scala b/src/library/scala/Product21.scala index 9c5215d640..b215c466ae 100644 --- a/src/library/scala/Product21.scala +++ b/src/library/scala/Product21.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product22.scala b/src/library/scala/Product22.scala index 7567a60547..f7e10a2652 100644 --- a/src/library/scala/Product22.scala +++ b/src/library/scala/Product22.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product3.scala b/src/library/scala/Product3.scala index 0e89c435a0..0fbd855b86 100644 --- a/src/library/scala/Product3.scala +++ b/src/library/scala/Product3.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product4.scala b/src/library/scala/Product4.scala index d581ce155b..efeec3c601 100644 --- a/src/library/scala/Product4.scala +++ b/src/library/scala/Product4.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product5.scala b/src/library/scala/Product5.scala index 734fe8c63f..64e59b6b1d 100644 --- a/src/library/scala/Product5.scala +++ b/src/library/scala/Product5.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product6.scala b/src/library/scala/Product6.scala index 0ea654dfa1..a2a819ef51 100644 --- a/src/library/scala/Product6.scala +++ b/src/library/scala/Product6.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product7.scala b/src/library/scala/Product7.scala index b7423a24ec..b9fa32bf00 100644 --- a/src/library/scala/Product7.scala +++ b/src/library/scala/Product7.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product8.scala b/src/library/scala/Product8.scala index 8eaa19c5b4..0f5aa6100a 100644 --- a/src/library/scala/Product8.scala +++ b/src/library/scala/Product8.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Product9.scala b/src/library/scala/Product9.scala index 37d6e5a311..6adce6023f 100644 --- a/src/library/scala/Product9.scala +++ b/src/library/scala/Product9.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Nov 04 18:46:21 CET 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple1.scala b/src/library/scala/Tuple1.scala index 4b36abdf41..d57c58fe78 100644 --- a/src/library/scala/Tuple1.scala +++ b/src/library/scala/Tuple1.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple10.scala b/src/library/scala/Tuple10.scala index ac3b8b6632..c9e38eec29 100644 --- a/src/library/scala/Tuple10.scala +++ b/src/library/scala/Tuple10.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple11.scala b/src/library/scala/Tuple11.scala index 6b5faadc18..546800f3af 100644 --- a/src/library/scala/Tuple11.scala +++ b/src/library/scala/Tuple11.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple12.scala b/src/library/scala/Tuple12.scala index edd91fc9da..0f2d4e9af0 100644 --- a/src/library/scala/Tuple12.scala +++ b/src/library/scala/Tuple12.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple13.scala b/src/library/scala/Tuple13.scala index f6714875a8..d9d540d334 100644 --- a/src/library/scala/Tuple13.scala +++ b/src/library/scala/Tuple13.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple14.scala b/src/library/scala/Tuple14.scala index 0a76401fcd..18ea35a9f4 100644 --- a/src/library/scala/Tuple14.scala +++ b/src/library/scala/Tuple14.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple15.scala b/src/library/scala/Tuple15.scala index a7a7973346..cb1742786c 100644 --- a/src/library/scala/Tuple15.scala +++ b/src/library/scala/Tuple15.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple16.scala b/src/library/scala/Tuple16.scala index fdcf4916d7..0af7feeb45 100644 --- a/src/library/scala/Tuple16.scala +++ b/src/library/scala/Tuple16.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple17.scala b/src/library/scala/Tuple17.scala index a1c906b781..ef02d51fc6 100644 --- a/src/library/scala/Tuple17.scala +++ b/src/library/scala/Tuple17.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple18.scala b/src/library/scala/Tuple18.scala index 1e1d8caab4..6f2489e41d 100644 --- a/src/library/scala/Tuple18.scala +++ b/src/library/scala/Tuple18.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple19.scala b/src/library/scala/Tuple19.scala index ed5e7945e0..ad69657e2c 100644 --- a/src/library/scala/Tuple19.scala +++ b/src/library/scala/Tuple19.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple2.scala b/src/library/scala/Tuple2.scala index c20f521afb..2a4797ab5a 100644 --- a/src/library/scala/Tuple2.scala +++ b/src/library/scala/Tuple2.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 (with extra methods) package scala @@ -19,12 +19,10 @@ import scala.collection.generic.CanBuildFrom /** Tuple2 is the canonical representation of a @see Product2 * */ -case class Tuple2[+T1, +T2](_1:T1, _2:T2) extends Product2[T1, T2] { - override def toString() = { - val sb = new StringBuilder - sb.append('(').append(_1).append(',').append(_2).append(')') - sb.toString - } +case class Tuple2[+T1, +T2](_1:T1,_2:T2) + extends Product2[T1, T2] +{ + override def toString() = "(" + _1 + "," + _2 + ")" /** Swap the elements of the tuple */ def swap: Tuple2[T2,T1] = Tuple2(_2, _1) diff --git a/src/library/scala/Tuple20.scala b/src/library/scala/Tuple20.scala index 14821a5e9d..5f4d4b26e8 100644 --- a/src/library/scala/Tuple20.scala +++ b/src/library/scala/Tuple20.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple21.scala b/src/library/scala/Tuple21.scala index 43a78e0edb..780cbd15ad 100644 --- a/src/library/scala/Tuple21.scala +++ b/src/library/scala/Tuple21.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple22.scala b/src/library/scala/Tuple22.scala index b77a39c88c..f45cab85fa 100644 --- a/src/library/scala/Tuple22.scala +++ b/src/library/scala/Tuple22.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple3.scala b/src/library/scala/Tuple3.scala index 16314ee813..b70310db3f 100644 --- a/src/library/scala/Tuple3.scala +++ b/src/library/scala/Tuple3.scala @@ -8,14 +8,13 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala import scala.collection.{TraversableLike, IterableLike} import scala.collection.generic.CanBuildFrom - /** Tuple3 is the canonical representation of a @see Product3 * */ diff --git a/src/library/scala/Tuple4.scala b/src/library/scala/Tuple4.scala index 3beb3fbfcd..fbf5d341a4 100644 --- a/src/library/scala/Tuple4.scala +++ b/src/library/scala/Tuple4.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple5.scala b/src/library/scala/Tuple5.scala index 2cff721795..033f26263d 100644 --- a/src/library/scala/Tuple5.scala +++ b/src/library/scala/Tuple5.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple6.scala b/src/library/scala/Tuple6.scala index b0b539ffa0..d360adad2a 100644 --- a/src/library/scala/Tuple6.scala +++ b/src/library/scala/Tuple6.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple7.scala b/src/library/scala/Tuple7.scala index e440d721a0..5a080c2e0e 100644 --- a/src/library/scala/Tuple7.scala +++ b/src/library/scala/Tuple7.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple8.scala b/src/library/scala/Tuple8.scala index a8487513eb..551c5e5d34 100644 --- a/src/library/scala/Tuple8.scala +++ b/src/library/scala/Tuple8.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/Tuple9.scala b/src/library/scala/Tuple9.scala index df31eda6a8..8098daaf40 100644 --- a/src/library/scala/Tuple9.scala +++ b/src/library/scala/Tuple9.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 +// generated by genprod on Sun Jan 17 19:38:09 PST 2010 package scala diff --git a/src/library/scala/collection/IterableLike.scala b/src/library/scala/collection/IterableLike.scala index 2e86b90479..8446988821 100644 --- a/src/library/scala/collection/IterableLike.scala +++ b/src/library/scala/collection/IterableLike.scala @@ -138,6 +138,38 @@ self => b.result } + /** Partitions elements in fixed size ${coll}s. + * @see Iterator#grouped + * + * @param size the number of elements per group + * @return An iterator producing ${coll}s of size `size`, except the + * last will be truncated if the elements don't divide evenly. + */ + def grouped(size: Int): Iterator[Repr] = + for (xs <- iterator grouped size) yield { + val b = newBuilder + b ++= xs + b.result + } + + /** Groups elements in fixed size blocks by passing a "sliding window" + * over them (as opposed to partitioning them, as is done in grouped.) + * @see Iterator#sliding + * + * @param size the number of elements per group + * @param step the distance between the first elements of successive + * groups (defaults to 1) + * @return An iterator producing ${coll}s of size `size`, except the + * last will be truncated if the elements don't divide evenly. + */ + def sliding[B >: A](size: Int): Iterator[Repr] = sliding(size, 1) + def sliding[B >: A](size: Int, step: Int): Iterator[Repr] = + for (xs <- iterator.sliding(size, step)) yield { + val b = newBuilder + b ++= xs + b.result + } + /** Selects last ''n'' elements. * $orderDependent * diff --git a/src/library/scala/collection/Iterator.scala b/src/library/scala/collection/Iterator.scala index c23765c9bc..de0ec5275f 100644 --- a/src/library/scala/collection/Iterator.scala +++ b/src/library/scala/collection/Iterator.scala @@ -554,7 +554,7 @@ trait Iterator[+A] { self => * of the returned iterator is the maximum of the lengths of this iterator and `that`. * If this iterator is shorter than `that`, `thisElem` values are used to pad the result. * If `that` is shorter than this iterator, `thatElem` values are used to pad the result. - * @usecase def zipAll[B](that: Iterator[B], thisElem: A, thatElem: B): Iterator[(A, B1)] + * @usecase def zipAll[B](that: Iterator[B], thisElem: A, thatElem: B): Iterator[(A, B)] */ def zipAll[B, A1 >: A, B1 >: B](that: Iterator[B], thisElem: A1, thatElem: B1) = new Iterator[(A1, B1)] { def hasNext = self.hasNext || that.hasNext diff --git a/src/library/scala/collection/immutable/HashSet.scala b/src/library/scala/collection/immutable/HashSet.scala index 25a8059b0c..2320187be9 100644 --- a/src/library/scala/collection/immutable/HashSet.scala +++ b/src/library/scala/collection/immutable/HashSet.scala @@ -115,17 +115,20 @@ class HashSet[A] extends Set[A] private def makeCopy(last: HashSet[A]) { def undo(m: HashSet[A]) { - if (m ne last) { - undo(m.later) - if (m.deleted) addEntry(m.changedElem) - else removeEntry(m.changedElem) - } + if (m.deleted) addEntry(m.changedElem) + else removeEntry(m.changedElem) } table = new scala.Array[AnyRef](last.table.length) scala.Array.copy(last.table, 0, table, 0, table.length) tableSize = last.tableSize threshold = last.threshold - undo(this) + + // we need to work from the end of the list but non-tail-recursion + // potentially blows the stack, so instead we create a stack on the heap. + // See ticket #408. + val toUndo = new mutable.Stack[HashSet[A]] + toUndo pushAll ((Iterator iterate this)(_.later) takeWhile (_ ne last)) + toUndo foreach undo later = null } diff --git a/src/library/scala/collection/mutable/WrappedArray.scala b/src/library/scala/collection/mutable/WrappedArray.scala index cedeb673e0..6652f5e40a 100644 --- a/src/library/scala/collection/mutable/WrappedArray.scala +++ b/src/library/scala/collection/mutable/WrappedArray.scala @@ -43,6 +43,9 @@ abstract class WrappedArray[T] extends IndexedSeq[T] with ArrayLike[T, WrappedAr def array: Array[T] override def stringPrefix = "WrappedArray" + /** Clones this object, including the underlying Array. */ + override def clone: WrappedArray[T] = WrappedArray make array.clone() + /** Creates new builder for this collection ==> move to subclasses */ override protected[this] def newBuilder: Builder[T, WrappedArray[T]] = @@ -50,7 +53,6 @@ abstract class WrappedArray[T] extends IndexedSeq[T] with ArrayLike[T, WrappedAr } object WrappedArray { - def make[T](x: AnyRef): WrappedArray[T] = x match { case x: Array[AnyRef] => wrapRefArray[AnyRef](x).asInstanceOf[WrappedArray[T]] case x: Array[Int] => wrapIntArray(x).asInstanceOf[WrappedArray[T]] diff --git a/src/library/scala/runtime/ArrayRuntime.java b/src/library/scala/runtime/ArrayRuntime.java new file mode 100644 index 0000000000..b382fdf8f6 --- /dev/null +++ b/src/library/scala/runtime/ArrayRuntime.java @@ -0,0 +1,16 @@ +package scala.runtime; + +/** + * Methods on Java arrays + */ +class ArrayRuntime { + static boolean[] cloneArray(boolean[] array) { return array.clone(); } + static byte[] cloneArray(byte[] array) { return array.clone(); } + static short[] cloneArray(short[] array) { return array.clone(); } + static char[] cloneArray(char[] array) { return array.clone(); } + static int[] cloneArray(int[] array) { return array.clone(); } + static long[] cloneArray(long[] array) { return array.clone(); } + static float[] cloneArray(float[] array) { return array.clone(); } + static double[] cloneArray(double[] array) { return array.clone(); } + static Object[] cloneArray(Object[] array) { return array.clone(); } +} diff --git a/src/library/scala/runtime/ScalaRunTime.scala b/src/library/scala/runtime/ScalaRunTime.scala index ecc81c074e..2f6ffb5535 100644 --- a/src/library/scala/runtime/ScalaRunTime.scala +++ b/src/library/scala/runtime/ScalaRunTime.scala @@ -74,6 +74,20 @@ object ScalaRunTime { case null => throw new NullPointerException } + def array_clone(xs: AnyRef): AnyRef = xs match { + case x: Array[AnyRef] => ArrayRuntime.cloneArray(x) + case x: Array[Int] => ArrayRuntime.cloneArray(x) + case x: Array[Double] => ArrayRuntime.cloneArray(x) + case x: Array[Long] => ArrayRuntime.cloneArray(x) + case x: Array[Float] => ArrayRuntime.cloneArray(x) + case x: Array[Char] => ArrayRuntime.cloneArray(x) + case x: Array[Byte] => ArrayRuntime.cloneArray(x) + case x: Array[Short] => ArrayRuntime.cloneArray(x) + case x: Array[Boolean] => ArrayRuntime.cloneArray(x) + case x: Array[Unit] => x + case null => throw new NullPointerException + } + /** Convert a numeric value array to an object array. * Needed to deal with vararg arguments of primtive types that are passed * to a generic Java vararg parameter T ... diff --git a/src/library/scala/util/control/TailCalls.scala b/src/library/scala/util/control/TailCalls.scala new file mode 100644 index 0000000000..59e9618028 --- /dev/null +++ b/src/library/scala/util/control/TailCalls.scala @@ -0,0 +1,56 @@ +package scala.util.control + +/** Methods exported by this object implement tail calls via trampolining. + * Tail calling methods have to return their result using `done` or call the next + * method using `tailcall`. Both return a `TailRec` object. The result of evaluating + * a tailcalling function can be retrieved from a `Tailrec` value using method result`. + * Here's a usage example: + * {{{ + * import scala.util.control.TailCalls._ + * + * def isEven(xs: List[Int]): TailRec[Boolean] = + * if (xs.isEmpty) done(true) else tailcall(isOdd(xs.tail)) + * + * def isOdd(xs: List[Int]): TailRec[Boolean] = + * if (xs.isEmpty) done(false) else tailcall(isEven(xs.tail)) + * + * isEven((1 to 100000).toList).result + * }}} + */ +object TailCalls { + + /** This class represents a tailcalling computation. + */ + abstract class TailRec[+A] { + /** Returns the result of the tailcalling computation + */ + def result: A = { + def loop(body: TailRec[A]): A = body match { + case Call(rest) => loop(rest()) + case Done(result) => result + } + loop(this) + } + } + + /** Internal class representing a tailcall */ + protected case class Call[A](rest: () => TailRec[A]) extends TailRec[A] + + /** Internal class representing the final result return from a tailcalling computation */ + protected case class Done[A](override val result: A) extends TailRec[A] + + /** Performs a tailcall + * @param rest the expression to be evaluated in the tailcall + * @return a `TailRec` object representing the expression `rest` + */ + def tailcall[A](rest: => TailRec[A]): TailRec[A] = new Call(() => rest) + + /** Used to return final result from tailcalling computation + * @param `result` the result value + * @return a `TailRec` object representing a computation which immediately returns `result` + */ + def done[A](result: A): TailRec[A] = new Done(result) + +} + + diff --git a/src/library/scala/util/control/TailRec.scala b/src/library/scala/util/control/TailRec.scala deleted file mode 100644 index db6cbfa2ed..0000000000 --- a/src/library/scala/util/control/TailRec.scala +++ /dev/null @@ -1,24 +0,0 @@ -package scala.util.control - -abstract class TailRec[+A] - -object TailRec { - - case class Call[A](rest: () => TailRec[A]) extends TailRec[A] - case class Done[A](result: A) extends TailRec[A] - - def tailcall[A](rest: => TailRec[A]) = new Call(() => rest) - def done [A](result: A) = new Done(result) - def trampoline[A](body: TailRec[A]): A = { - def loop(body: TailRec[A]): A = body match { - case Call(rest) => loop(rest()) - case Done(result) => result - } - loop(body) - } - def loop[A](body: TailRec[A]): A = body match { - case Call(rest) => loop[A](rest()) - case Done(result) => result - } -} - |