This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Why is List the default Seq?

1 reply
missingfaktor
Joined: 2010-04-13,
User offline. Last seen 1 year 3 days ago.
Two days ago, I watched Daniel Spiewak's excellent Functional Data Structures talk. In that talk he mentions virtues of bitmapped vector trie. If Vector has so good performance characteristics for the common collection operations, why is List, and not Vector, the default Seq?

In case it isn't clear, the following is what I mean by List being a default Seq:
scala> Seq.range(1, 15)res112: Seq[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
--
Cheers,missingfaktor.
H-star Development
Joined: 2010-04-14,
User offline. Last seen 2 years 26 weeks ago.
Re: Why is List the default Seq?

because vector is new, and seq is old.

-------- Original-Nachricht --------
> Datum: Fri, 23 Dec 2011 14:37:02 +0530
> Von: missingfaktor
> An: scala-user
> Betreff: [scala-user] Why is List the default Seq?

> Two days ago, I watched Daniel Spiewak's excellent Functional Data
> Structures talk. In that talk he mentions virtues of bitmapped vector
> trie.
> If Vector has so good performance characteristics for the common
> collection
> operations, why is List, and not Vector, the default Seq?
>
> In case it isn't clear, the following is what I mean by List being a
> default Seq:
>
> scala> Seq.range(1, 15)
> res112: Seq[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland