scala-2.8

How to port Scala 2.7.7 code that uses scala.collection.jcl to Scala 2.8?

I've got some code that references scala.collection.jcl written against Scala 2.7.7. I'm now trying to compile it against Scala 2.8 for the first time, and I'm getting this error: "value jcl is not a member of package collection". Is there a substitute/replacement for jcl in 2.8? ...

Porting new Iterable{} code from Scala 2.7.7 to 2.8

I saw this thread: http://stackoverflow.com/questions/1243794/what-are-the-biggest-differences-between-scala-2-8-and-scala-2-7 It seems to cover some changes, but the first compile problems I've hit don't seem to be mentioned. Any suggestions? kinds of the type arguments (Iterable[Any] with (A with Int) => Any) do not conform to the...

How to create the Scaladoc for a Maven+Scala 2.8+Java-Project with Scaladoc 2

The question says it all. I couldn't find an example on the web how to use the Scaladoc 2, especially on a Maven Project. I'm using Maven, Scala 2.8 and some Java classes, and the Maven Scala Plugin to build the project. But as it seems i cannot use the Maven Scala Plugin (where i could run mvn scala:doc) to create the docs because it ...

Scala immutable objects and traits with val fields

Hi all, I would like to construct my domain model using immutable objects only. But I also want to use traits with val fields and move some functionality to traits. Please look at the following example: trait Versionable { val version = 0 def incrementVersion = copy(version=version+1) } Unfortunatelly such code doesn't work - copy ...

Proxies / delegates in Scala

I've seen several Scala questions recently (e.g. here, here, and here) that called for the use of proxies, and it's come up more than once in my own work. The Scala library has a number of proxy traits (14, if I counted correctly). Proxy classes/traits usually contain lots of boilerplate: class FooProxy(val self: Foo) extends Foo { ...

+= appends to stack in Scala 2.7.7; :+ does not seem to work in Scala 2.8.0

Using Scala 2.7.7, this works as expected: import scala.collection.mutable.Stack ... var x = new Stack[String] x += "Hello" println(x.top) After changing to Scala 2.8.0, the += should be replaced by :+. However, this does not append to the stack: java.util.NoSuchElementException: head of empty list. Am I overlooking something basic? ...

Scala 2.8 tools for production use

What are your experiences with Scala tools currently used in production? Given that Scala 2.8 has been out for over a month, I thought it would be a good time for an update on the status of Scala tooling, along the lines of these questions. I'd like to broaden the scope of the questions beyond IDEs, to include RAD tools (e.g. JRebel), b...

Enabling Migration Warnings

I am porting a 2.7.7 scala code base over to 2.8 and was wondering if there was a compiler option to display migration notices? I was bitten by a change in behavior for mutable sequences that had the following migration notice[1], however it doesn't display anything when I build the project ( I have deprecation and unchecked warnings ena...

Enumeration ids, disallowed in match operation?

Hi, I have an Enumeration class, and have extracted "id" values from some of the members and stored them in Int variables. Whether that was a good idea/not is not the question. What the question is, is why I cant seem to do the following: Let's say I have s : Int which holds one of these id values ... and I would like to do matching ...

Using Lift 2.1 on Google App Engine with Scala 2.8

Hi, I'm trying to use Lift 2.1-SNAPSHOT on Google App Engine but the lift snippets in the HTML are not being processed. It simple returns the HTML file. This is the lift.html file (just a simple test): <lift:surround with="default" at="content"> Welcome to your Lift application </lift:surround> The web.xml has: <filter> <filt...

Scala Annotation List?

I wanted to ask if there is a list of annotations for Scala 2.8.0? I stumbled upon @inline and @specialized but it would be nice if there is a complete list which also explains what they do exactly. If such a list doesn't exist: Are there some annotations one should be familiar with? ...

In a multidimensional sequence created with tabulate, is the innermost seq the 1. dimension?

As the title says, when creating a multidimensional sequence in scala with tabulate, is the innermost or outermost sequence the 1. dimension? For example, in a 2-dimensional Vector v, will v(2) give the second element of the 1. or of the 2. dimension? ...

Using Scala to cut up a large CSV file

What's the best way to do file IO in Scala 2.8? All I want to do is cut a massive CSV file into lots of smaller ones with, say 1000 lines of data per file, and each file retaining the header. ...

Nested trait in class constructor in scala

I'm playing around with scala (scala 2.8). Suppose I have a class with a nested trait, and want to use that nested trait as the type for a parameter in the class's constructor. Is that even possible? This is the closest I've come: class OuterClass(traitParam:OuterClass#InnerTrait) { trait InnerTrait { } val y:InnerTrait = traitPa...

What's the motive behind Chained Package clauses in Scala?

Chained package clause were introduced in Scala 2.8, as described by Martin Odersky on the Scala site. I don't quite get the intuition behind this. Following was the example in the Scala book for the nested packages: package bobsrockets { package navigation { // In package bobsrockets.navigation class Navigator ...

What are the limitations and walkarounds of Scala interpreter?

What kind of constructs need 'scalac' compile and how to make an equivalent that will work in interpreter? Edit: I want to use scala instead of python as a scripting language. (with #!/usr/bin/scala) ...

What is the most succinct Scala way to reverse a Map?

What is the most succinct Scala way to reverse a Map? The Map may contain non-unique values. EDIT: The reversal of Map[A, B] should give Map[B, Set[A]] (or a MultiMap, that would be even better). ...

Running Eclipse Scala Plugin with previous version of Scala

The scala plugin seems to automatically download version 2.8 of Scala. I'l like to try out the Gridgain 3.0-beta, which currently only works with Scala 2.7.7. Since Gridgain 3.0-beta already provides scala-compiler-2.7.7.jar and scala-library-2.7.7.jar, is it possible to get the Eclipse Scala Plugin to compile to Scala 2.7.7? I tried ...

Updating intelliJ IDEA

I'm using IntelliJ IDEA 9.0 community edition. The Scala plugin I use uses Scala 2.7.6. How do I update the plugin for Scala 2.8? Thanks. ...

Scala MouseEvent - How to know which button was pressed?

I'm writing a scala application using scala swing. I can listen for MouseClicked to get notified whenever the mouse is clicked, but how do i know which button was pressed. The documentation is pretty bad, so i have looked in the Java documentation for MouseEvent, which says that the key can be retrieved from the modifiers field, so i tri...