- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Default implementation for Seq() - documentation or implementation bug?
Mon, 2011-10-24, 00:25
Hi,
I just saw that the documentation for scala.collection.Seq says that the default implementation for Seq() was Vector:
/** $factoryInfo * The current default implementation of a $Coll is a `Vector`. * @define coll sequence * @define Coll Seq */object Seq extends SeqFactory[Seq] {
However, the implementation for immutable.Seq.newBuilder[A] is:
def newBuilder[A]: Builder[A, Seq[A]] = new mutable.ListBuffer
Is this a bug in the doc or in the code (I was expecting that Seq() was Vector based as the doc says)?
Eric.
I just saw that the documentation for scala.collection.Seq says that the default implementation for Seq() was Vector:
/** $factoryInfo * The current default implementation of a $Coll is a `Vector`. * @define coll sequence * @define Coll Seq */object Seq extends SeqFactory[Seq] {
However, the implementation for immutable.Seq.newBuilder[A] is:
def newBuilder[A]: Builder[A, Seq[A]] = new mutable.ListBuffer
Is this a bug in the doc or in the code (I was expecting that Seq() was Vector based as the doc says)?
Eric.
-- Martin
On Mon, Oct 24, 2011 at 1:25 AM, etorreborre <etorreborre@gmail.com> wrote:
--
Martin Odersky
Prof., EPFL and Chairman, Typesafe
PSED, 1015 Lausanne, Switzerland
Tel. EPFL: +41 21 693 6863
Tel. Typesafe: +41 21 691 4967