final object CollectionStrawMan5

A strawman architecture for new collections. It contains some example collection classes and methods with the intent to expose some key issues. It would be good to compare this to other implementations of the same functionality, to get an idea of the strengths and weaknesses of different collection architectures.

For a test file, see tests/run/CollectionTests.scala.

Strawman5 is like strawman4, but using inheritance through ...Like traits instead of decorators.

Advantage: Much easier to specialize. See partition for strict (buildable) collections or drop for Lists.

Disadvantage: More "weird" types in base traits; some awkwardness with

Constructors

Members

[+] class ArrayBuffer

Concrete collection type: ArrayBuffer

Concrete collection type: ArrayBuffer

[+] final object ArrayBuffer
[+] class ArrayBufferView
[+] trait Buildable

Base trait for strict collections

Base trait for strict collections

[+] trait Builder

Base trait for collection builders

Base trait for collection builders

[+] case class Cons
[+] final object Cons
[+] trait FromIterable

Base trait for instances that can construct a collection from an iterable

Base trait for instances that can construct a collection from an iterable

[+] trait Iterable

Base trait for generic collections

Base trait for generic collections

[+] trait IterableFactory

Base trait for companion objects of collections

Base trait for companion objects of collections

[+] trait IterableLike

Base trait for Iterable operations

VarianceNote

We require that for all child classes of Iterable the variance of the child class and the variance of the...

Base trait for Iterable operations

VarianceNote

We require that for all child classes of Iterable the variance of the child class and the variance of the C parameter passed to IterableLike are the same. We cannot express this since we lack variance polymorphism. That's why we have to resort at some places to write C[A @uncheckedVariance].

[+] trait IterableOnce

Iterator can be used only once

Iterator can be used only once

[+] trait IterableOps
[+] final object Iterator
[+] trait Iterator

A core Iterator class

A core Iterator class

[+] final object List
[+] sealed trait List

Concrete collection type: List

Concrete collection type: List

[+] class ListBuffer

Concrete collection type: ListBuffer

Concrete collection type: ListBuffer

[+] final object ListBuffer
[+] final object Nil
[+] trait RandomAccessView

View defined in terms of indexing a range

View defined in terms of indexing a range

[+] trait Seq

Base trait for sequence collections

Base trait for sequence collections

[+] trait SeqLike

Base trait for Seq operations

Base trait for Seq operations

[+] trait SeqMonoTransforms
[+] final class StringOps

Concrete collection type: String

Concrete collection type: String

[+] final object StringOps

Concrete collection type: String

Concrete collection type: String

[+] case class StringView
[+] final object StringView
[+] final object View
[+] trait View

Concrete collection type: View

Concrete collection type: View

[+] implicit def StringOps ( s: String ) : StringOps

Concrete collection type: String

Concrete collection type: String