Changes and Improvements on Scala 2.8

This document will summarize the changes and improvements on Scala 2.8 according to Scala 2.8 Preview, scala mailing lists, Scala Improvement Documents Library and Trac , etc.

Scaladoc2


General


Array


Redesigned collection libraries


Named and default arguments


Package objects

  • Packages can now be defined not just by files in some directory, but in addition by a special object that lists additional members of the package. For instance, you could add a number of type aliases, which would then be visible as members of the package. This functionality is used in the new collection libraries to ensure backwards compatibility. For instance class List in the new library will live in package scala.collection.immutable. But code that accesses it as a scala.List will still work, because there is a package object definition
  • http://lampsvn.epfl.ch/trac/scala/browser/scala/branches/2.8.0x/src/library/scala/package.scala

Beefed up Scala Swing libraries

  • There will be new functionality and better documentation in the scala.swing package.

Support for continuations

Type specialization


Revamped REPL


Packrat parser combinators


Nested Annotation


Override val

  • The operational semantics for override val will be changed.
  • Until 2.7.4.finail, the following code becomes 0. On the other hand, it will be 1 on 2.8.
    trait A{val x=0}; class B extends A{override val x=1}; println((new B).x)

@tailrec and @switch


scala.util.control.TailRec


scala.util.control.Exception


scala.io.Source


scala.collection.Seq


scala.FunctionX


scala.Actor



scala.util.control.Breaks


Compiler Phase Initialization and Plugins


Stream


Parser combinators


scala.reflect.Invocation


scala.util.Random

  • shuffle and alphanumeric methods are added.

Pattern Match

  • Changeset 29018
    • If the scrutinee is final and does not conform to the pattern, it will no longer compile.

scala.xml


Manifest


Comments