Is there any game engine in Scala?
I wonder if there are any game engine written in Scala or easily accesible from Scala? ...
I wonder if there are any game engine written in Scala or easily accesible from Scala? ...
I want to set an expected exception for a JUnit 4 test using Scala. I am current doing something similar to the following: @Test(expected=classOf[NullPointerException]) def someTest() = { // Some test code } But I get the following compiler error: error: wrong number of arguments for constructor Test: ()org.junit.Test ...
I understand Ruby and Python's yield. What does Scala's yield do? ...
Are there any libraries written for Scala enabling Functional Reactive Programming? ...
I have the following implicit conversion for java.util.Enumerations implicit def enumerationIterator[A](e : Enumeration[A]) : Iterator[A] = { new Iterator[A] { def hasNext = e.hasMoreElements def next = e.nextElement def remove = throw new UnsupportedOperationException() } } Unfortunately it doe...
Suppose I have some class which has a property actor_ of type Actor. Is there a problem with me doing def someMethod() = { actor_ ! "HELLO" } Or should sending a message always be done from another actor; e.g. def someMethod() = { Actor.actor { actor_ ! "HELLO" } } ...
I have a remote actor (client) which is registering with another remote actor (server) and then later deregistering (with a shutdown hook). However, although the server picks up the de-registration, the actual sender property is a different Channel object; so in my server logs I have: Registered new client [scala.actors.Channel@158e2...
I have a server which is using the remote actors framework to communicate with multiple clients. As mentioned in this question, I am having trouble keeping track of when a client disappears. Hence my server is still attempting to send messages to non-existent clients. Is this a problem? (I don't see any exceptions being thrown - but I ...
When I call: actor_ ! Exit How is this being converted into a construction of: case class Exit(from: AbstractActor, reason: AnyRef) In particular, how is it that when I call this from a remote (client) actor which has been linked to a remote (server) actor, that the server receives an instance of Exit where the from property is an ...
I've just seen this case class in the Scala actors package: case class ! [a](ch: Channel[a], msg: a) And in the JavaDoc it describes usage in the following form: receive { case Chan1 ! msg1 => ... case Chan2 ! msg2 => ... } Why is this not: receive { case !(Chan1, msg1) => ... case !(Chan2, msg2) => ... } Is the bang ope...
What is the difference between the map and flatMap functions of Iterable? ...
I'm looking for a simple line or two of code that will grab an rss feed like this php line: $feed = "URL" from within a scala object. I'm using scala/lift with Netbeans or Eclipse if it's relevant ...
It is my opinion that every language was created for a specific purpose. What was Scala created for and what problems does it best solve? ...
What is the analog in Scala of doing this in Java: public class Outer { private Inner inner; public static class Inner { } public Inner getInner() { return inner; } } I specifically want my inner class to not have to have a fully qualified name - i.e. I want Trade.Type, not TradeType. So in Scala I imagined it might be somet...
Trying to learn a bit of Scala and ran into this problem. I found a solution for all combinations without repetions here and I somewhat understand the idea behind it but some of the syntax is messing me up. I also don't think the solution is appropriate for a case WITH repetitions. I was wondering if anyone could suggest a bit of code th...
Is there an easy way to convert a java.lang.Iterable[_] to a Scala.Iterable[_] ? ...
I would like to create a java List based on another java Collection eg. Set in Scala. Why is this not possible? I get a required: scala.this.Int error. val in: java.util.Set[String] = new java.util.HashSet() val out : java.util.List[String] = new java.util.ArrayList(in) This worked however, but doesn't feel right: val in: java.util....
I'm looking for a way to matching a string that may contain an integer value. If so, parse it. I'd like to write code similar to the following: def getValue(s: String): Int = s match { case "inf" => Integer.MAX_VALUE case Int(x) => x case _ => throw ... } The goal is that if the string equals "inf", return In...
I don't understand why authors said that Code Listing 9.1 from "Programming in Scala" use closure. In chapter 9, they show how to refactor code into more less duplicated form, from this original code: object FileMatcher { private def filesHere = (new java.io.File(".")).listFiles def filesEnding(query: String) = for (file <- file...
Quick Note: Examples from this tutorial. Suppose I have the following Traits: Student, Worker, Underpaid, Young How could I declare a class (not instance) CollegeStudent with all these traits? Note: I am aware of the simplests cases, such as CollegeStudent with one or two Traits: class CollegeStudent extends Student with Worker ...