| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sanity check:
scala> case class P2(i: Int, j: Int)
defined class P2
val p2 = P2(1, 3)
p2.productElement(0)
res0: Any = 1
p2.productElement(1)
res1: Any = 3
p2.productElement(2)
java.lang.IndexOutOfBoundsException: 2
at P2.productElement(<console>:10)
|
| |
|
|
|
|
| |
Fix SI-5168.
|
|
|
|
| |
as errors. Fixed erasure scheme.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moved unlift to the Function companion object, which might have been
better in the first place. Had to make a minor change to genprod, and
then I couldn't escape that unscathed. Finished the not very complete
undertaking I found there to update the scaladoc. Lots of little changes
to the generated text and code.
I changed genprod to only put a unique stamp on Function0 so we can stop
having a 100 file diff everytime an i is dotted somewhere.
Closes #3825, no review.
|
| |
|
|
|
|
|
|
|
| |
Documentation being generated by genprod was pretty busted both in terms
of formatting and correctness. Spruced it up. Eliminated some of the
more distracting HTML entities in compiler source. No review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An overhaul of the collection-oriented methods in Tuple2/Tuple3 (which
still need to be taken all the way to Tuple5.)
* Zip semantics: zip and zipped now properly terminate when any
collection runs out of elements, even if others are infinite. In
addition, short circuiting methods (exists and forall) will terminate if
the condition is met, even in the presence of infinity.
Example:
scala> val ys = Stream from 1
ys: scala.collection.immutable.Stream[Int] = Stream(1, ?)
scala> (ys, ys).zipped forall ((x, y) => x+y < 100)
res0: Boolean = false
scala> (ys, ys).zipped exists ((x, y) => x+y > 100)
res1: Boolean = true
* There are implicits converting Zipped2/3 to Traversable to expose all
the methods which aren't defined in an arity-specific way in the tuple
classes. I have mixed feelings about putting these in Predef; but if
there is another way to make them visible by default I wasn't able to
find it.
Example putting said implicit to use:
scala> (ys, ys, ys).zipped find { case (x, y, z) => x+y+z > 1000 }
res0: Option[(Int, Int, Int)] = Some((334,334,334))
Already reviewed by moors, so no review.
|
|
|
|
|
|
|
| |
Proposed implementation of 'unlift' on Function1, the inverse function
of PartialFunction#lift. Review by rytz and other interested parties.
References #3825, but not closing until this is further considered.
|
|
|
|
|
| |
Removed more than 3400 svn '$Id' keywords and related junk.
|
|
|
|
|
|
|
| |
to properly specialize on primitive types (scala.Int, instead of
scala.runtime.Int). Now closures should be indeed specialized. No
review.
|
|
|
|
|
|
|
|
| |
Regenerated tuples, products and (Abstract)Functions. We needed to have
separate files for AbstractFunctionN because the compiler may need their
symbol even before their sourcefile is parsed. In such cases it relies
on finding a source file with the right name.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
only for classes created after Scala 1.4
|
|
|
|
|
|
| |
Newly generated Tuple/Product/Function classes from new genprod, plus a
couple minor tweaks to genprod to keep tests happy.
|
| |
|
|
|
|
|
|
|
|
|
| |
FunctionN, where N > 4, many fewer classes are created statically at the
expense of creating more objects dynamically (which seems reasonable
given how common such functions are likely to be). This also allows for
curry in FunctionN for N > 8 without running into the filename length
restriction.
|
| |
|
|
|
|
|
| |
No curry for you! (If you are FunctionN, for N < 2 and N > 16)
|
|
|
|
|
| |
Generalized curry to FunctionN for N >= 2
|
|
|
|
|
| |
Added uncurry to Function2, swap to Tuple2.
|
| |
|
|
|
|
|
| |
updated element/arity to productElement/productArity
|
|
|
|
|
| |
renamed arity=>productArity,element=>productElement
|
|
|
|
|
|
|
| |
finalized the TupleN ProductN change (last dist: no automatic addition
of ProductN, this dist: manual addition of ProductN to TupleN by means
of modified genprod tool)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* better comments and parameter names in scala.xml.MetaData typechecker
* now handles special cases (n=0, n=1) for unapply correctly
* * even if one returns a Option[Product1[T]]
* typechecker now handles unapply return types correctly
* * e.g. when returning Option[{A,B}] instead of Option[Product2[A,B]]
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
more products, plus some static optimization in pattern matcher
|
| |
|
| |
|
|
|