Another tour of Scala

 
 
 
 

Scala Packages

Viewing old version 34ead7944b509419f08239f36b101cc41f67a036; View Current

The Gist

Scala Packages gives an overview of what packages in Scala are.

My Interpretation

On the surface, they are a slightly more flexible version of Java’s imports:

However, this doesn’t really touch on some of the subtleties of how Scala treats packages.

Read This for a detailed overview of some very subtle behavior.

My Thoughts on this Feature

I think it’s a shame that packages in Scala are essentially packages in Java. Importing always seems like a compiler hint, that, in this day and age, seems ridiculous. It’s another example of Java’s love of repeating information already given (I have to tell the JVM not just which jars I need on my classpath, but also which classes from those jars I need at compile time?!?!? Why!??!). It would be so great if Scala had integrated real high-level package importing and not just made Java’s version slightly better.

I think the ability to rename a class is nice, but I can’t say I’ve ever wanted this feature, and feel it could lead to some really hard to follow code.

Further, the behavior described in the linked article is INSANE. Why would anyone want that behavior?


Last Updated 07/31/2009 at 08:07:09 PM by davec

blog comments powered by Disqus