Multiple packages definition

This is basically the same as

package scala.util.parsing.combinator.syntactical

import scala.util.parsing._
import scala.util.parsing.combinator._

...

So by “stacking” the packages the way you wrote you can get super-packages in scope. See also these answers.

[Update] Here is a new article written by Martin Odersky about this topic: http://www.artima.com/scalazine/articles/chained_package_clauses_in_scala.html

Leave a Comment