Reputation: 1431
I was surprised to learn that there's an alternate syntax for package declaration in Scala:
package a
package b
package c
(as opposed to package a.b.c
)
What's the use case for this alternate syntax? When should I use it instead of the standard one?
What's the design rationale behind it?
Upvotes: 5
Views: 766
Reputation: 39577
You get the members of those enclosing packages as it were for free, "visible under their simple names" (9.2 of the spec).
That includes type definitions and functions in the package object.
Upvotes: 3