scala-2.8 Questions

4

Solved

I can see in the API docs for Predef that they're subclasses of a generic function type (From) => To, but that's all it says. Um, what? Maybe there's documentation somewhere, but search engines don...
Obedient asked 6/8, 2010 at 20:3

3

Solved

On migrating our code to Scala 2.9 we've found large swathes of it that didn't work and failed silently. We tracked it down to case classes that extend Proxy not being equal. In our code we don't e...
Nucleate asked 12/7, 2011 at 16:27

5

Solved

The definitive reference for using Scala on android seems to be here: http://www.scala-lang.org/node/160 Unfortunately, all the references on using scala with android are based around Scala 2.7 an...
Pharsalus asked 3/5, 2010 at 21:46

1

Solved

Scala's collection library contains the forwarders IterableForwarder, TraversableForwarder, SeqForwarder and proxies like IterableProxy, MapProxy, SeqProxy, SetProxy, TraversableProxy, etc. Forward...
Byssus asked 20/4, 2011 at 22:50

1

Solved

How do we define a multiple primary key and a foreign key in ScalaQuery? object myTable1 extends Table([Int])("myTable1") { def id = column[Int]("id", O PrimaryKey) def * = id } object myTable...
Lantha asked 18/3, 2011 at 3:16

1

I am sending my Scala Actor its messages from a for loop. The scala actor is receiving the messages and getting to the job of processing them. The actors are processing cpu and disk intensive task...
Ormand asked 10/3, 2011 at 7:46

3

Solved

I'm writing a DSL where the "+" operator is strictly numeric, like some other popular languages. It's close, but the String "+" operator is messing up my implicit conversions. What's the syntax for...
Sukin asked 18/4, 2010 at 22:36

3

Solved

How do I access XML data files directly from a zipped file in my Scala program? Are there any direct ways to programmatically unzip and read contents in my Scala code?
Parthenogenesis asked 1/3, 2011 at 10:59

1

What does this error mean? scala> val a = Array[{ def x: Int }](new { def x = 3 }) <console>:5: error: type mismatch; found : scala.reflect.Manifest[java.lang.Object] required: scala.r...
Denunciation asked 14/2, 2011 at 10:45

3

Solved

I.e. Is it possible to make a var that is not assignable from outside of the class ?
Vicious asked 14/2, 2011 at 0:33

3

Solved

Assume you have a List(1,"1") it is typed List[Any], which is of course correct and expected. Now if I map the list like this scala> List(1, "1") map { | case x: Int => x | case y: String ...
Molality asked 7/2, 2010 at 22:3

2

Solved

It's more easily explained in code: class Bippy { val x = 42 class Boppy { val y = "hello world" } val bop = new Boppy } val bip = new Bippy val bop: Bippy#Boppy = bip.bop bop is then su...
Snug asked 7/2, 2011 at 21:29

1

Solved

I'm trying to invoke the newInstance method of a constructor of a Scala class (case class or usual class, both are affected). However, I'm running into a IllegalArgumentException with the hint wro...
Subscript asked 2/2, 2011 at 7:24

2

Solved

Please point me to correct link if this has been answered before. I have this code: def getResult(a:Any):Any = a def getAnswer[T](i:Int) = { val result = getResult(i) result match { case t:T ...
Famulus asked 1/2, 2011 at 6:8

4

Solved

Define the following code: import scala.collection.JavaConversions._ val iter:java.util.Iterator[Any] = Array[Any](1, 2, 3).iterator def func(a:Any):String = a.toString def test[T:ClassManifest]...
Unrestraint asked 31/1, 2011 at 12:41

1

Solved

I would like to create a templating plugin and as the first step convert an arbitrary string to it's "compiled" AST representation (as the scala interpreter does, I guess). So a compiler plugin cou...
Staghound asked 26/1, 2011 at 22:14

3

Solved

My problem is very simple but I haven't found an efficient implementation yet. Suppose there is a matrix A like this: 0 0 0 0 0 0 0 4 4 2 2 2 0 0 4 4 2 2 2 0 0 0 0 2 2 2 1 1 0 0 0 0 0 1 1 Now I...
Chamade asked 11/1, 2011 at 10:39

1

Solved

I have to call some Java library code that returns an untyped java.util.List and I can't seem to convert this into a Scala 2.8 list without the compiler borking with the following error: [INFO] fo...
Knighthood asked 7/1, 2011 at 17:40

4

Solved

Adding two Set[Int] works: Welcome to Scala version 2.8.1.final (Java HotSpot(TM) Server VM, Java 1.6.0_23). Type in expressions to have them evaluated. Type :help for more information. scala>...
Flapper asked 6/1, 2011 at 21:39

6

Solved

I'm trying to reduce the extent to which I write Scala (2.8) like Java. Here's a simplification of a problem I came across. Can you suggest improvements on my solutions that are "more functional"? ...
Jessiajessica asked 27/12, 2010 at 18:22

5

Solved

I have the following set of sets. I don't know ahead of time how long it will be. val sets = Set(Set("a","b","c"), Set("1","2"), Set("S","T")) I would like to expand it into a cartesian product:...
Goosy asked 23/5, 2010 at 15:36

4

Solved

I found that when using pattern matching with alternatives (for strings), Scala accepts variables starting with upper case (in the example below, MyValue1 and MyValue2), but not those starting with...
Pyatt asked 18/12, 2010 at 18:42

4

Solved

One of the new features of Scala 2.8 are context bounds. What is a context bound and where is it useful? Of course I searched first (and found for example this) but I couldn't find any really clea...
Boyse asked 5/6, 2010 at 22:1

4

Solved

I assume that there is probably no satisfactory answer to this question, but I ask it anyway in case I missed something. Basically, I want to find out the line in the source document from which a ...
Actual asked 15/12, 2010 at 2:14

2

Solved

Really struggling to figure out extending the immutable Set with a class that will represent a Set of concrete type. I'm doing this to try and create a nice DSL. I'd like to have a class Thing, an...
Swallow asked 11/12, 2010 at 13:17

© 2022 - 2024 — McMap. All rights reserved.