Skip to main content
Add a sentence about inheritance.
Source Link
Jörg W Mittag
  • 104.8k
  • 24
  • 226
  • 327

The Scala Collection Framework is a good example of this. There are mutable and immutable collections as well as serial and parallel (and in the future maybe distributed as well) collections. So, there are, for example, four Map traits:

scala.collection.Map
scala.collection.immutable.Map
scala.collection.mutable.Map
scala.collection.concurrent.Map

plus three ParMaps:

scala.collecion.parallel.ParMap
scala.collecion.parallel.immutable.ParMap
scala.collecion.parallel.mutable.ParMap

Even more interesting:

scala.collection.immutable.Map            extends scala.collection.Map
scala.collection.mutable.Map              extends scala.collection.Map
scala.collection.concurrent.Map           extends scala.collection.mutable.Map

scala.collecion.parallel.ParMap           extends scala.collection.Map
scala.collecion.parallel.immutable.ParMap extends scala.collecion.parallel.ParMap
scala.collecion.parallel.mutable.ParMap   extends scala.collecion.parallel.ParMap

So, ParMap extends ParMap extends Map and Map extends Map extends Map.

But, let's face it: what else would you call them? This makes perfect sense. That's what namespaces are for!

The Scala Collection Framework is a good example of this. There are mutable and immutable collections as well as serial and parallel (and in the future maybe distributed as well) collections. So, there are, for example, four Map traits:

scala.collection.Map
scala.collection.immutable.Map
scala.collection.mutable.Map
scala.collection.concurrent.Map

plus three ParMaps:

scala.collecion.parallel.ParMap
scala.collecion.parallel.immutable.ParMap
scala.collecion.parallel.mutable.ParMap

Even more interesting:

scala.collection.immutable.Map            extends scala.collection.Map
scala.collection.mutable.Map              extends scala.collection.Map
scala.collection.concurrent.Map           extends scala.collection.mutable.Map

scala.collecion.parallel.ParMap           extends scala.collection.Map
scala.collecion.parallel.immutable.ParMap extends scala.collecion.parallel.ParMap
scala.collecion.parallel.mutable.ParMap   extends scala.collecion.parallel.ParMap

But, let's face it: what else would you call them? This makes perfect sense. That's what namespaces are for!

The Scala Collection Framework is a good example of this. There are mutable and immutable collections as well as serial and parallel (and in the future maybe distributed as well) collections. So, there are, for example, four Map traits:

scala.collection.Map
scala.collection.immutable.Map
scala.collection.mutable.Map
scala.collection.concurrent.Map

plus three ParMaps:

scala.collecion.parallel.ParMap
scala.collecion.parallel.immutable.ParMap
scala.collecion.parallel.mutable.ParMap

Even more interesting:

scala.collection.immutable.Map            extends scala.collection.Map
scala.collection.mutable.Map              extends scala.collection.Map
scala.collection.concurrent.Map           extends scala.collection.mutable.Map

scala.collecion.parallel.ParMap           extends scala.collection.Map
scala.collecion.parallel.immutable.ParMap extends scala.collecion.parallel.ParMap
scala.collecion.parallel.mutable.ParMap   extends scala.collecion.parallel.ParMap

So, ParMap extends ParMap extends Map and Map extends Map extends Map.

But, let's face it: what else would you call them? This makes perfect sense. That's what namespaces are for!

Fix typo.
Source Link
Jörg W Mittag
  • 104.8k
  • 24
  • 226
  • 327

The Scala Collection Framework is a good example of this. There are mutable and immutable collections as well as serial and parallel (and in the future maybe distributed as well) collections. So, there are, for example, four Map traits:

scala.collection.Map
scala.collection.immutable.Map
scala.collection.mutable.Map
scala.collection.concurrent.Map

plus three ParMaps:

scala.collecion.parallel.ParMap
scala.collecion.parallel.immutable.ParMap
scala.collecion.parallel.mutable.ParMap

Even more interesting:

scala.collection.immutable.Map            extends scala.collection.Map
scala.collection.mutable.Map              extends scala.collection.Map
scala.collection.concurrent.Map           extends scala.collection.mutable.Map

scala.collecion.parallel.ParMap           extends scala.collection.Map
scala.collecion.parallel.immutable.ParMap extends scala.collecion.parallel.ParMap
scala.collecion.parallel.mutable.ParMap   extends scala.collecion.parallel.ParMap

But, let's face it: what else would you call them? This makes perfect sense. That's what namespaces orare for!

The Scala Collection Framework is a good example of this. There are mutable and immutable collections as well as serial and parallel (and in the future maybe distributed as well) collections. So, there are, for example, four Map traits:

scala.collection.Map
scala.collection.immutable.Map
scala.collection.mutable.Map
scala.collection.concurrent.Map

plus three ParMaps:

scala.collecion.parallel.ParMap
scala.collecion.parallel.immutable.ParMap
scala.collecion.parallel.mutable.ParMap

Even more interesting:

scala.collection.immutable.Map            extends scala.collection.Map
scala.collection.mutable.Map              extends scala.collection.Map
scala.collection.concurrent.Map           extends scala.collection.mutable.Map

scala.collecion.parallel.ParMap           extends scala.collection.Map
scala.collecion.parallel.immutable.ParMap extends scala.collecion.parallel.ParMap
scala.collecion.parallel.mutable.ParMap   extends scala.collecion.parallel.ParMap

But, let's face it: what else would you call them? This makes perfect sense. That's what namespaces or for!

The Scala Collection Framework is a good example of this. There are mutable and immutable collections as well as serial and parallel (and in the future maybe distributed as well) collections. So, there are, for example, four Map traits:

scala.collection.Map
scala.collection.immutable.Map
scala.collection.mutable.Map
scala.collection.concurrent.Map

plus three ParMaps:

scala.collecion.parallel.ParMap
scala.collecion.parallel.immutable.ParMap
scala.collecion.parallel.mutable.ParMap

Even more interesting:

scala.collection.immutable.Map            extends scala.collection.Map
scala.collection.mutable.Map              extends scala.collection.Map
scala.collection.concurrent.Map           extends scala.collection.mutable.Map

scala.collecion.parallel.ParMap           extends scala.collection.Map
scala.collecion.parallel.immutable.ParMap extends scala.collecion.parallel.ParMap
scala.collecion.parallel.mutable.ParMap   extends scala.collecion.parallel.ParMap

But, let's face it: what else would you call them? This makes perfect sense. That's what namespaces are for!

Source Link
Jörg W Mittag
  • 104.8k
  • 24
  • 226
  • 327

The Scala Collection Framework is a good example of this. There are mutable and immutable collections as well as serial and parallel (and in the future maybe distributed as well) collections. So, there are, for example, four Map traits:

scala.collection.Map
scala.collection.immutable.Map
scala.collection.mutable.Map
scala.collection.concurrent.Map

plus three ParMaps:

scala.collecion.parallel.ParMap
scala.collecion.parallel.immutable.ParMap
scala.collecion.parallel.mutable.ParMap

Even more interesting:

scala.collection.immutable.Map            extends scala.collection.Map
scala.collection.mutable.Map              extends scala.collection.Map
scala.collection.concurrent.Map           extends scala.collection.mutable.Map

scala.collecion.parallel.ParMap           extends scala.collection.Map
scala.collecion.parallel.immutable.ParMap extends scala.collecion.parallel.ParMap
scala.collecion.parallel.mutable.ParMap   extends scala.collecion.parallel.ParMap

But, let's face it: what else would you call them? This makes perfect sense. That's what namespaces or for!