summaryrefslogtreecommitdiff
path: root/src/build/genprod.scala
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2007-04-12 14:30:11 +0000
committerBurak Emir <emir@epfl.ch>2007-04-12 14:30:11 +0000
commit5bb26aa18d774162828693bb8c4fcc246359ecf5 (patch)
tree9eb5b85e7452ad334fe209741166726af0bdc2d2 /src/build/genprod.scala
parent34856ebaeccf44adace4dba8c44ba2155e231b83 (diff)
downloadscala-5bb26aa18d774162828693bb8c4fcc246359ecf5.tar.gz
scala-5bb26aa18d774162828693bb8c4fcc246359ecf5.tar.bz2
scala-5bb26aa18d774162828693bb8c4fcc246359ecf5.zip
renamed arity=>productArity,element=>productEle...
renamed arity=>productArity,element=>productElement
Diffstat (limited to 'src/build/genprod.scala')
-rw-r--r--src/build/genprod.scala28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/build/genprod.scala b/src/build/genprod.scala
index ae74e82f00..367809b847 100644
--- a/src/build/genprod.scala
+++ b/src/build/genprod.scala
@@ -26,6 +26,7 @@ object genprod {
val SUP_PRODUCT_ARITY = 23
val SUP_TUPLE_ARITY = 23
val SUP_FUNCTION_ARITY = 9
+ val SUP_CHOICE_ARITY = 9 // not implemented yet
def productClassname(i: Int) = "Product"+i
@@ -39,6 +40,10 @@ object genprod {
def functionFilename(i: Int) = functionClassname(i)+".scala"
+ def choiceClassname(i: Int) = "Choice"+i
+
+ def choiceFilename(i: Int) = choiceClassname(i)+".scala"
+
def targs(i: Int) =
for (val j <- List.range(1, i+1)) yield "T" + j
@@ -82,6 +87,9 @@ object genprod {
def functionFiles =
for(val i <- List.range(0, SUP_FUNCTION_ARITY)) yield FunctionFile.make(i)
+ //def choiceFiles =
+ // for(val i <- List.range(2, SUP_CHOICE_ARITY)) yield ChoiceFile.make(i)
+
def allfiles =
productFiles ::: tupleFiles ::: functionFiles
@@ -303,7 +311,23 @@ trait {productClassname(i)}{__typeArgs__} extends Product {{
* The arity of this product.
* @return {i}
*/
- override def arity = {i}
+ @deprecated override def arity = productArity
+
+ /**
+ * The arity of this product.
+ * @return {i}
+ */
+ override def productArity = {i}
+
+ /**
+ * Returns the n-th projection of this product if 0&amp;lt;=n&amp;lt;arity,
+ * otherwise <code>null</code>.
+ *
+ * @param n number of the projection to be returned
+ * @return same as _(n+1)
+ * @throws IndexOutOfBoundsException
+ */
+ @deprecated override def element(n: Int) = productElement(n)
/**
* Returns the n-th projection of this product if 0&amp;lt;=n&amp;lt;arity,
@@ -313,7 +337,7 @@ trait {productClassname(i)}{__typeArgs__} extends Product {{
* @return same as _(n+1)
* @throws IndexOutOfBoundsException
*/
- override def element(n: Int) = n match {{
+ override def productElement(n: Int) = n match {{
{for(val Tuple2(m, j) <- mdefs(i).zip(List.range(0, i)))
yield "case "+j+" => "+m+"\n "}case _ => throw new IndexOutOfBoundsException(n.toString())
}}