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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With