Chained package clause were introduced in Scala 2.8, as described by Martin Odersky on the Scala site. I don't quite get the intuition behind this.
Following was the example in the Scala book for the nested packages:
package bobsrockets {
package navigation {
// In package bobsrockets.navigation
class Navigator
package tests {
// In package bobsrockets.navigation.tests
class NavigatorSuite
}
}
}
This use case of nested packages made sense because we could use multiple nested packages in the same file, however the new syntax achieves the same thing as before but without the brackets. Won't it be difficult to separate out the package in between the succinct Scala code?
package bobsrockets
package navigation
// In package bobsrockets.navigation
class Navigator
package tests
// In package bobsrockets.navigation.tests
class NavigatorSuite
Please let me know if I'm getting it the wrong way or if I misunderstand the concept.