Dual package statements in Scala

package, scala

Solution

That is equivalent to this:

package cc.spray.http
import cc.spray._
// implicitly, import cc.spray.http._

That is, every member of package `cc.spray` and of package `cc.spray.http` are visible. On the other hand, members of the package `cc` are not visible.

This way one can safely use names such as `java` in their package hierarchy without causing trouble, and, at the same time, easily make visible the package scopes one wants to be visible.

Problem

I have seen in a few libraries, Spray for example, dual package specifications like this: ``` package cc.spray package http // code ``` Is this just eye candy for package cc.spray.http, or is there a functional benefit to breaking the two apart like this?

Original source