This page is no longer maintained — Please continue to the home page at www.scala-lang.org

deprecate objects like Predef / scala.swing.Swing

No replies
wookietreiber
Joined: 2011-04-24,
User offline. Last seen 42 years 45 weeks ago.

Hi _

since there are package objects for a while now and their use increases,
objects like

scala.Predef and
scala.swing.Swing

seem a little outdated and, imho, should be deprecated, i.e. their types, vals,
defs, ... should be moved to better 'places'. I'm using these two objects as
examples, because for both there are very suitable package objects:

package object scala.swing
for scala.swing.Swing

pacakge object scala
package object scala.sys (used already for e.g. exit and error)
for scala.Predef

Another reason is, that writing stuff like

import scala.swing._
import scala.swing.Swing._

to get basic swing stuff is kinda bloaty and may be avoided if scala.swing.Swing
would be merged into the package object.

I don't know if there are other reasonable examples for objects which were
created before the golden era of package objects that could/should now be merged
into their better suited package objects.

if (hasBeenDiscussedBefore)
remind()
else
startDiscussion()

Best regards
Christian Krause aka wookietreiber

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland