diff options
27 files changed, 66 insertions, 97 deletions
diff --git a/src/build/genprod.scala b/src/build/genprod.scala index d1c610d046..d587d0464d 100644 --- a/src/build/genprod.scala +++ b/src/build/genprod.scala @@ -15,7 +15,7 @@ * @author Burak Emir, Stephane Micheloud, Geoffrey Washburn, Paul Phillips * @version 1.1 */ -object genprod extends Application { +object genprod extends App { val MAX_ARITY = 22 def arities = (1 to MAX_ARITY).toList @@ -38,6 +38,7 @@ object genprod extends Application { def to = (1 to i).toList def s = if (i == 1) "" else "s" def className = name + i + def classAnnotation = "" def fileName = className + ".scala" def targs = to map ("T" + _) def vdefs = to map ("v" + _) @@ -72,7 +73,6 @@ package %s """.trim.format(genprodString, packageDef, imports) } - def args = arguments if (args.length != 1) { println("please give path of output directory") exit(-1) @@ -110,8 +110,9 @@ object FunctionZero extends Function(0) { } object FunctionOne extends Function(1) { + override def classAnnotation = "@annotation.implicitNotFound(msg = \"No implicit view available from ${T1} => ${R}.\")\n" override def contravariantSpecs = "@specialized(scala.Int, scala.Long, scala.Float, scala.Double) " - override def covariantSpecs = "@specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double) " + override def covariantSpecs = "@specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double) " override def descriptiveComment = functionNTemplate.format("succ", "anonfun1", """ @@ -183,7 +184,7 @@ class Function(val i: Int) extends Group("Function") with Arity { /** A function of {i} parameter{s}. * {descriptiveComment} */ -trait {className}{contraCoArgs} extends AnyRef {{ self => +{classAnnotation}trait {className}{contraCoArgs} extends AnyRef {{ self => /** Apply the body of this function to the argument{s}. * @return the result of function application. */ @@ -298,7 +299,7 @@ object TupleTwo extends Tuple(2) * }}} * * @see Zipped - * $willNotTerminateInf + * Note: will not terminate for infinite-sized collections. */ def zipped[Repr1, El1, Repr2, El2](implicit w1: T1 => TLike[El1, Repr1], w2: T2 => ILike[El2, Repr2]): Zipped[Repr1, El1, Repr2, El2] = new Zipped[Repr1, El1, Repr2, El2](_1, _2) @@ -406,7 +407,7 @@ object TupleThree extends Tuple(3) { * }}} * * @see Zipped - * $willNotTerminateInf + * Note: will not terminate for infinite-sized collections. */ def zipped[Repr1, El1, Repr2, El2, Repr3, El3](implicit w1: T1 => TLike[El1, Repr1], w2: T2 => ILike[El2, Repr2], diff --git a/src/library/scala/Function0.scala b/src/library/scala/Function0.scala index d17122c0d8..f8e68a2e04 100644 --- a/src/library/scala/Function0.scala +++ b/src/library/scala/Function0.scala @@ -6,7 +6,7 @@ ** |/ ** \* */ // GENERATED CODE: DO NOT EDIT. -// genprod generated these sources at: Sat Feb 19 20:13:51 PST 2011 +// genprod generated these sources at: Wed Mar 30 13:47:19 PDT 2011 package scala diff --git a/src/library/scala/Option.scala b/src/library/scala/Option.scala index ef2cbcfd31..c2b1764fdb 100644 --- a/src/library/scala/Option.scala +++ b/src/library/scala/Option.scala @@ -21,7 +21,7 @@ object Option { */ def apply[A](x: A): Option[A] = if (x == null) None else Some(x) - /** An Option factory which returns $none in a manner consistent with + /** An Option factory which returns `None` in a manner consistent with * the collections hierarchy. */ def empty[A] : Option[A] = None diff --git a/src/library/scala/Tuple2.scala b/src/library/scala/Tuple2.scala index fc9b348fdb..afac96fe97 100644 --- a/src/library/scala/Tuple2.scala +++ b/src/library/scala/Tuple2.scala @@ -49,7 +49,7 @@ case class Tuple2[@specialized(Int, Long, Double) +T1, @specialized(Int, Long, D * }}} * * @see Zipped - * $willNotTerminateInf + * Note: will not terminate for infinite-sized collections. */ def zipped[Repr1, El1, Repr2, El2](implicit w1: T1 => TLike[El1, Repr1], w2: T2 => ILike[El2, Repr2]): Zipped[Repr1, El1, Repr2, El2] = new Zipped[Repr1, El1, Repr2, El2](_1, _2) diff --git a/src/library/scala/Tuple3.scala b/src/library/scala/Tuple3.scala index 2f533b10b2..6458fa5042 100644 --- a/src/library/scala/Tuple3.scala +++ b/src/library/scala/Tuple3.scala @@ -46,7 +46,7 @@ case class Tuple3[+T1, +T2, +T3](_1: T1, _2: T2, _3: T3) * }}} * * @see Zipped - * $willNotTerminateInf + * Note: will not terminate for infinite-sized collections. */ def zipped[Repr1, El1, Repr2, El2, Repr3, El3](implicit w1: T1 => TLike[El1, Repr1], w2: T2 => ILike[El2, Repr2], diff --git a/src/library/scala/collection/Map.scala b/src/library/scala/collection/Map.scala index 075317a483..7dcaafe45d 100644 --- a/src/library/scala/collection/Map.scala +++ b/src/library/scala/collection/Map.scala @@ -13,7 +13,7 @@ import generic._ /** * A map from keys of type `A` to values of type `B`. * - * $mapnote + * $mapNote * * '''Note:''' If you do not have specific implementations for `add` and `-` in mind, * you might consider inheriting from `DefaultMap` instead. diff --git a/src/library/scala/collection/TraversableOnce.scala b/src/library/scala/collection/TraversableOnce.scala index a233e519b3..f660d31ab2 100644 --- a/src/library/scala/collection/TraversableOnce.scala +++ b/src/library/scala/collection/TraversableOnce.scala @@ -37,11 +37,17 @@ import annotation.unchecked.{ uncheckedVariance => uV } * @since 2.8 * * @define coll traversable or iterator + * @define orderDependent + * + * Note: might return different results for different runs, unless the underlying collection type is ordered. * @define orderDependentFold * * Note: might return different results for different runs, unless the * underlying collection type is ordered or the operator is associative * and commutative. + * @define mayNotTerminateInf + * + * Note: may not terminate for infinite-sized collections. * @define willNotTerminateInf * * Note: will not terminate for infinite-sized collections. diff --git a/src/library/scala/collection/TraversableViewLike.scala b/src/library/scala/collection/TraversableViewLike.scala index 6f7f7f5a28..b5b18b7a8a 100644 --- a/src/library/scala/collection/TraversableViewLike.scala +++ b/src/library/scala/collection/TraversableViewLike.scala @@ -30,7 +30,7 @@ trait ViewMkString[+A] { } /** A template trait for non-strict views of traversable collections. - * $traversableviewinfo + * $traversableViewInfo * * Implementation note: Methods such as `map` or `flatMap` on this view will not invoke the implicitly passed * `Builder` factory, but will return a new view directly, to preserve by-name behavior. @@ -38,14 +38,14 @@ trait ViewMkString[+A] { * that takes a `View` as its `From` type parameter must yield the same view (or a generic * superclass of it) as its result parameter. If that assumption is broken, cast errors might result. * - * @define viewinfo + * @define viewInfo * A view is a lazy version of some collection. Collection transformers such as * `map` or `filter` or `++` do not traverse any elements when applied on a view. * Instead they create a new view which simply records that fact that the operation * needs to be applied. The collection elements are accessed, and the view operations are applied, * when a non-view result is needed, or when the `force` method is called on a view. - * @define traversableviewinfo - * $viewinfo + * @define traversableViewInfo + * $viewInfo * * All views for traversable collections are defined by creating a new `foreach` method. diff --git a/src/library/scala/collection/generic/Addable.scala b/src/library/scala/collection/generic/Addable.scala index d80e85c039..5be428305e 100644 --- a/src/library/scala/collection/generic/Addable.scala +++ b/src/library/scala/collection/generic/Addable.scala @@ -16,10 +16,10 @@ package generic * @tparam A the type of the elements of the $coll * @tparam Repr the type of the $coll itself * @author Martin Odersky - * @version 2.8 - * @since 2.8 - * @define $coll collection - * @define $Coll Addable + * @version 2.8 + * @since 2.8 + * @define coll collection + * @define Coll Addable */ @deprecated("Will be removed after scala 2.9") trait Addable[A, +Repr <: Addable[A, Repr]] { self => diff --git a/src/library/scala/collection/generic/ClassManifestTraversableFactory.scala b/src/library/scala/collection/generic/ClassManifestTraversableFactory.scala index 69ae465806..82270d5728 100644 --- a/src/library/scala/collection/generic/ClassManifestTraversableFactory.scala +++ b/src/library/scala/collection/generic/ClassManifestTraversableFactory.scala @@ -6,20 +6,14 @@ ** |/ ** \* */ - package scala.collection package generic - - - - abstract class ClassManifestTraversableFactory[CC[X] <: Traversable[X] with GenericClassManifestTraversableTemplate[X, CC]] -extends GenericClassManifestCompanion[CC] { + extends GenericClassManifestCompanion[CC] { class GenericCanBuildFrom[A](implicit manif: ClassManifest[A]) extends CanBuildFrom[CC[_], A, CC[A]] { def apply(from: CC[_]) = from.genericClassManifestBuilder[A] def apply = newBuilder[A] } - } diff --git a/src/library/scala/collection/generic/GenericClassManifestCompanion.scala b/src/library/scala/collection/generic/GenericClassManifestCompanion.scala index b85fc93cba..546e82fb4a 100644 --- a/src/library/scala/collection/generic/GenericClassManifestCompanion.scala +++ b/src/library/scala/collection/generic/GenericClassManifestCompanion.scala @@ -6,17 +6,12 @@ ** |/ ** \* */ - - package scala.collection package generic import mutable.Builder - - - -/** This class represents companions of classes which require classmanifests +/** This class represents companions of classes which require ClassManifests * for their element types. * * @author Aleksandar Prokopec @@ -34,4 +29,3 @@ abstract class GenericClassManifestCompanion[+CC[X] <: Traversable[X]] { b.result } } - diff --git a/src/library/scala/collection/generic/GenericClassManifestTraversableTemplate.scala b/src/library/scala/collection/generic/GenericClassManifestTraversableTemplate.scala index 80415f8e79..03d426946b 100644 --- a/src/library/scala/collection/generic/GenericClassManifestTraversableTemplate.scala +++ b/src/library/scala/collection/generic/GenericClassManifestTraversableTemplate.scala @@ -6,17 +6,12 @@ ** |/ ** \* */ - - package scala.collection package generic import mutable.Builder import annotation.unchecked.uncheckedVariance - - - /** This trait represents collections classes which require class * manifests for their element types. * @@ -27,4 +22,3 @@ trait GenericClassManifestTraversableTemplate[+A, +CC[X] <: Traversable[X]] exte def classManifestCompanion: GenericClassManifestCompanion[CC] def genericClassManifestBuilder[B](implicit man: ClassManifest[B]): Builder[B, CC[B]] = classManifestCompanion.newBuilder[B] } - diff --git a/src/library/scala/collection/generic/GenericCompanion.scala b/src/library/scala/collection/generic/GenericCompanion.scala index 5aa9656cf2..084f884ebb 100644 --- a/src/library/scala/collection/generic/GenericCompanion.scala +++ b/src/library/scala/collection/generic/GenericCompanion.scala @@ -6,8 +6,6 @@ ** |/ ** \* */ - - package scala.collection package generic diff --git a/src/library/scala/collection/generic/GenericParCompanion.scala b/src/library/scala/collection/generic/GenericParCompanion.scala index 0da1a3a543..9e151e7543 100644 --- a/src/library/scala/collection/generic/GenericParCompanion.scala +++ b/src/library/scala/collection/generic/GenericParCompanion.scala @@ -1,14 +1,13 @@ package scala.collection.generic - import scala.collection.parallel.Combiner import scala.collection.parallel.ParIterable import scala.collection.parallel.ParMap - - /** A template class for companion objects of parallel collection classes. * They should be mixed in together with `GenericCompanion` type. + * + * @define Coll ParIterable * @tparam CC the type constructor representing the collection class * @since 2.8 */ diff --git a/src/library/scala/collection/generic/Subtractable.scala b/src/library/scala/collection/generic/Subtractable.scala index 158a3cac60..1b3425d792 100644 --- a/src/library/scala/collection/generic/Subtractable.scala +++ b/src/library/scala/collection/generic/Subtractable.scala @@ -16,10 +16,10 @@ package generic * @tparam A the type of the elements of the $coll. * @tparam Repr the type of the $coll itself * @author Martin Odersky - * @version 2.8 - * @since 2.8 - * @define $coll collection - * @define $Coll Subtractable + * @version 2.8 + * @since 2.8 + * @define coll collection + * @define Coll Subtractable */ trait Subtractable[A, +Repr <: Subtractable[A, Repr]] { self => diff --git a/src/library/scala/collection/immutable/IntMap.scala b/src/library/scala/collection/immutable/IntMap.scala index 140ba4dbec..ea68b53518 100644 --- a/src/library/scala/collection/immutable/IntMap.scala +++ b/src/library/scala/collection/immutable/IntMap.scala @@ -35,6 +35,11 @@ private[immutable] object IntMapUtils extends BitOperations.Int { import IntMapUtils._ /** A companion object for integer maps. + * + * @define Coll IntMap + * @define mapCanBuildFromInfo + * The standard `CanBuildFrom` instance for `$Coll` objects. + * The created value is an instance of class `MapCanBuildFrom`. * @since 2.7 */ object IntMap { diff --git a/src/library/scala/collection/immutable/LongMap.scala b/src/library/scala/collection/immutable/LongMap.scala index d5f1374540..030dd72d35 100644 --- a/src/library/scala/collection/immutable/LongMap.scala +++ b/src/library/scala/collection/immutable/LongMap.scala @@ -35,9 +35,14 @@ private[immutable] object LongMapUtils extends BitOperations.Long { import LongMapUtils._ /** A companion object for long maps. + * + * @define Coll LongMap + * @define mapCanBuildFromInfo + * The standard `CanBuildFrom` instance for `$Coll` objects. + * The created value is an instance of class `MapCanBuildFrom`. * @since 2.7 */ -object LongMap{ +object LongMap { /** $mapCanBuildFromInfo */ implicit def canBuildFrom[A, B] = new CanBuildFrom[LongMap[A], (Long, B), LongMap[B]] { def apply(from: LongMap[A]): Builder[(Long, B), LongMap[B]] = apply() @@ -69,7 +74,6 @@ object LongMap{ else LongMap.Bin[S](prefix, mask, left, right); } } - } import LongMap._ diff --git a/src/library/scala/collection/mutable/DoubleLinkedList.scala b/src/library/scala/collection/mutable/DoubleLinkedList.scala index 9dc5ee0f20..2d630c3756 100644 --- a/src/library/scala/collection/mutable/DoubleLinkedList.scala +++ b/src/library/scala/collection/mutable/DoubleLinkedList.scala @@ -66,7 +66,7 @@ class DoubleLinkedList[A]() extends LinearSeq[A] * @define Coll DoubleLinkedList */ object DoubleLinkedList extends SeqFactory[DoubleLinkedList] { - /** $genericCanBuildFrom */ + /** $genericCanBuildFromInfo */ implicit def canBuildFrom[A]: CanBuildFrom[Coll, A, DoubleLinkedList[A]] = new GenericCanBuildFrom[A] def newBuilder[A]: Builder[A, DoubleLinkedList[A]] = diff --git a/src/library/scala/collection/mutable/IndexedSeqView.scala b/src/library/scala/collection/mutable/IndexedSeqView.scala index 12b0229ae1..6af00d03b1 100644 --- a/src/library/scala/collection/mutable/IndexedSeqView.scala +++ b/src/library/scala/collection/mutable/IndexedSeqView.scala @@ -16,7 +16,7 @@ import generic._ import TraversableView.NoBuilder /** A non-strict view of a mutable `IndexedSeq`. - * $viewinfo + * $viewInfo * Some of the operations of this class will yield again a mutable indexed sequence, * others will just yield a plain indexed sequence of type `collection.IndexedSeq`. * Because this is a leaf class there is no associated `Like' class. diff --git a/src/library/scala/collection/parallel/ParIterable.scala b/src/library/scala/collection/parallel/ParIterable.scala index 48b0e35151..aeed6949c7 100644 --- a/src/library/scala/collection/parallel/ParIterable.scala +++ b/src/library/scala/collection/parallel/ParIterable.scala @@ -6,15 +6,12 @@ ** |/ ** \* */ - package scala.collection.parallel - import scala.collection.generic._ import scala.collection.parallel.mutable.ParArrayCombiner import scala.collection.parallel.mutable.ParArray - /** A template trait for parallel iterable collections. * * $paralleliterableinfo @@ -35,7 +32,7 @@ trait ParIterable[+T] extends Iterable[T] override def companion: GenericCompanion[ParIterable] with GenericParCompanion[ParIterable] = ParIterable } -/** $factoryinfo +/** $factoryInfo */ object ParIterable extends ParFactory[ParIterable] { implicit def canBuildFrom[T]: CanCombineFrom[Coll, T, ParIterable[T]] = new GenericCanCombineFrom[T] @@ -44,17 +41,3 @@ object ParIterable extends ParFactory[ParIterable] { def newCombiner[T]: Combiner[T, ParIterable[T]] = ParArrayCombiner[T] } - - - - - - - - - - - - - - diff --git a/src/library/scala/collection/parallel/immutable/ParHashMap.scala b/src/library/scala/collection/parallel/immutable/ParHashMap.scala index 84705c33e7..11d4a02e18 100644 --- a/src/library/scala/collection/parallel/immutable/ParHashMap.scala +++ b/src/library/scala/collection/parallel/immutable/ParHashMap.scala @@ -146,7 +146,7 @@ self => } -/** $factoryinfo +/** $factoryInfo * @define Coll immutable.ParHashMap * @define coll immutable parallel hash map */ diff --git a/src/library/scala/collection/parallel/immutable/ParHashSet.scala b/src/library/scala/collection/parallel/immutable/ParHashSet.scala index 29c6eb0f93..e292a3ef72 100644 --- a/src/library/scala/collection/parallel/immutable/ParHashSet.scala +++ b/src/library/scala/collection/parallel/immutable/ParHashSet.scala @@ -127,7 +127,7 @@ self => } -/** $factoryinfo +/** $factoryInfo * @define Coll immutable.ParHashSet * @define coll immutable parallel hash set */ diff --git a/src/library/scala/collection/parallel/immutable/ParIterable.scala b/src/library/scala/collection/parallel/immutable/ParIterable.scala index c4da1ced8e..085f5220dd 100644 --- a/src/library/scala/collection/parallel/immutable/ParIterable.scala +++ b/src/library/scala/collection/parallel/immutable/ParIterable.scala @@ -44,7 +44,7 @@ extends collection.immutable.Iterable[T] } -/** $factoryinfo +/** $factoryInfo */ object ParIterable extends ParFactory[ParIterable] { implicit def canBuildFrom[T]: CanCombineFrom[Coll, T, ParIterable[T]] = diff --git a/src/library/scala/collection/parallel/mutable/ParArray.scala b/src/library/scala/collection/parallel/mutable/ParArray.scala index f976098f5e..0ac009d58c 100644 --- a/src/library/scala/collection/parallel/mutable/ParArray.scala +++ b/src/library/scala/collection/parallel/mutable/ParArray.scala @@ -682,7 +682,7 @@ self => } -/** $factoryinfo +/** $factoryInfo * @define Coll mutable.ParArray * @define coll parallel array */ diff --git a/src/library/scala/collection/parallel/mutable/ParHashMap.scala b/src/library/scala/collection/parallel/mutable/ParHashMap.scala index 2945bcdc61..a3f3c33af5 100644 --- a/src/library/scala/collection/parallel/mutable/ParHashMap.scala +++ b/src/library/scala/collection/parallel/mutable/ParHashMap.scala @@ -141,7 +141,7 @@ self => } -/** $factoryinfo +/** $factoryInfo * @define Coll mutable.ParHashMap * @define coll parallel hash map */ diff --git a/src/library/scala/collection/parallel/mutable/ParIterable.scala b/src/library/scala/collection/parallel/mutable/ParIterable.scala index fcba75452f..cd0c45bd0d 100644 --- a/src/library/scala/collection/parallel/mutable/ParIterable.scala +++ b/src/library/scala/collection/parallel/mutable/ParIterable.scala @@ -39,7 +39,7 @@ trait ParIterable[T] extends collection.mutable.Iterable[T] override def toSeq: ParSeq[T] = toParCollection[T, ParSeq[T]](() => ParSeq.newCombiner[T]) } -/** $factoryinfo +/** $factoryInfo */ object ParIterable extends ParFactory[ParIterable] { implicit def canBuildFrom[T]: CanCombineFrom[Coll, T, ParIterable[T]] = diff --git a/src/library/scala/util/logging/Logged.scala b/src/library/scala/util/logging/Logged.scala index 3ec70c00c6..e07c14da6b 100644 --- a/src/library/scala/util/logging/Logged.scala +++ b/src/library/scala/util/logging/Logged.scala @@ -6,34 +6,25 @@ ** |/ ** \* */ - - package scala.util.logging -/** <p> - * Mixing in the class <code>Logged</code> indicates that a class provides - * support for logging. For instance, the developer of a library writes - * </p> - * <pre> - * <b>class</b> MyClass <b>extends</b> Logged { /* do stuff, call log */ } - * </pre> - * <p> - * The user of the library instantiates: - * </p> - * <pre> - * <b>val</b> x = <b>new</b> MyClass() <b>with</b> ConsoleLogger - * </pre> - * <p> - * and the logging will be sent to the <a href="../../Console$object.html" - * target="contentFrame"><code>Console</code></a> object. - * </p> +/** Mixing in Logged indicates that a class provides support for logging. + * For instance: +{{{ + // The developer of the library writes: + class MyClass extends Logged { + // do stuff, call log + } + // The user of the library instantiates: + val x = new MyClass() with ConsoleLogger +}}} + * and the logging is sent to the [[ConsoleLogger]] object. */ trait Logged { - /** This method should log the message given as argument somewhere * as a side-effect. * - * @param msg ... + * @param msg message to be logged */ def log(msg: String): Unit = {} } |