diff options
author | Paul Phillips <paulp@improving.org> | 2010-01-18 05:02:30 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-01-18 05:02:30 +0000 |
commit | 853b1817beb5f8b55ecbd1ffdf0e226fc699acae (patch) | |
tree | ce44fe7e2cc25670aecd70f36e70ae9f0cfe399f /src/build/genprod.scala | |
parent | d73a32db9cb0357cb365b78bdbd0fa8d6af9873c (diff) | |
download | scala-853b1817beb5f8b55ecbd1ffdf0e226fc699acae.tar.gz scala-853b1817beb5f8b55ecbd1ffdf0e226fc699acae.tar.bz2 scala-853b1817beb5f8b55ecbd1ffdf0e226fc699acae.zip |
Adjectified some parts of speech as discussed o...
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.
Diffstat (limited to 'src/build/genprod.scala')
-rw-r--r-- | src/build/genprod.scala | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/build/genprod.scala b/src/build/genprod.scala index ae2a3d7972..099c24ef20 100644 --- a/src/build/genprod.scala +++ b/src/build/genprod.scala @@ -209,37 +209,37 @@ trait {className}{contraCoArgs} extends AnyRef {{ self => List.map2(xdefs, targs)("(%s: %s) => ".format(_, _)).mkString("", "", body) } - // (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7) => self.apply(x1,x2,x3,x4,x5,x6,x7)).curry + // (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7) => self.apply(x1,x2,x3,x4,x5,x6,x7)).curried def longCurry = (List.map2(xdefs, targs)(_ + ": " + _) drop 1).mkString( "(x1: T1) => ((", ", ", - ") => self.apply%s).curry".format(commaXs) + ") => self.apply%s).curried".format(commaXs) ) - // 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 curryComment = { """ - /** f%s == (f.curry)%s + /** f%s == (f.curried)%s */ """.format(commaXs, xdefs map ("(" + _ + ")") mkString) } def tupleMethod = { def comment = """ - /* f%s == (f.tuple)(Tuple%d%s) + /* f%s == (f.tupled)(Tuple%d%s) */ """.format(commaXs, i, commaXs) def body = "case Tuple%d%s => apply%s".format(i, commaXs, commaXs) - comment + " def tuple: Tuple%d%s => R = {\n %s\n }\n".format(i, invariantArgs, body) + comment + " def tupled: Tuple%d%s => R = {\n %s\n }\n".format(i, invariantArgs, body) } def curryMethod = { val body = if (i < 5) shortCurry else longCurry curryComment + - " def curry: %s => R = {\n %s\n }\n".format( + " def curried: %s => R = {\n %s\n }\n".format( targs mkString " => ", body - ) + ) + """ @deprecated("Use 'curried' instead")""" + "\n def curry = curried\n" } override def moreMethods = curryMethod + tupleMethod |