Questions tagged [scala]
Scala is a general-purpose programming language principally targeting the Java Virtual Machine. Designed to express common programming patterns in a concise, elegant, and type-safe way, it fuses both imperative and functional programming styles. Its key features are: an advanced static type system with type inference; function types; pattern-matching; implicit parameters and conversions; operator overloading; full interoperability with Java; concurrency
scala
112,623
questions
53
votes
4
answers
9k
views
why is the lift web framework scalable?
I want to know the technical reasons why the lift webframework has high performance and scalability? I know it uses scala, which has an actor library, but according to the install instructions it ...
7
votes
5
answers
833
views
Do you plan to use the Scala programming language and on what project?
Where do you seen using Scala for your project?
121
votes
7
answers
40k
views
What is the rationale behind having companion objects in Scala?
Is there a case where a companion object (singleton) for a class is needed? Why would I want to create a class, say Foo and also create a companion object for it?
10
votes
3
answers
3k
views
Type parameters versus member types in Scala
I'd like to know how do the member types work in Scala, and how should I associate types.
One approach is to make the associated type a type parameter. The advantages of this approach is that I can ...
7
votes
1
answer
2k
views
How does the "specs" BDD framework for Scala work?
I'm just getting started with Scala, and I'm wondering which language feature allows you to do this:
"PersistentQueue" should {
"add and remove one item" in {
withTempFolder {
val q = new ...
2
votes
2
answers
5k
views
Scala: splitting a list using a predicate for sublists
I just had a use case where I needed to split a list into n sublists, so that elements are taken in order from the original list and grouped while the predicate is true for the sublist (when it is ...
7
votes
3
answers
3k
views
Unpacking tuple types in Scala
I was just wondering, can I decompose a tuple type into its components' types in Scala?
I mean, something like this
trait Container {
type Element
}
trait AssociativeContainer extends Container {
...
22
votes
3
answers
6k
views
Design patterns for Agent / Actor based concurrent design [closed]
Recently i have been getting into alternative languages that support an actor/agent/shared nothing architecture - ie. scala, clojure etc (clojure also supports shared state).
So far most of the ...
15
votes
3
answers
3k
views
Does Scala's pattern matching violate the Open/Closed Principle?
If I add a new case class, does that mean I need to search through all of the pattern matching code and find out where the new class needs to be handled? I've been learning the language recently, and ...
19
votes
8
answers
4k
views
Is anyone using Scala in anger (and what advice for a Java programmer)? [closed]
I've been a Java programmer for over 10 years since starting off with Smalltalk. It's my opinion that next big languages are likely to be ones which run on the ubiquitous Java Virtual Machine. I'd ...
17
votes
6
answers
6k
views
Scala remote actors
Are there any guides or tutorials which explain the possibility to use scala actors remotely? All I have found until now is one example (without comments) but that's hardly enough.
5
votes
2
answers
3k
views
Creating a parametric graph type in Scala
I'd like to create a generic type hierarchy for representing graphs. In particular, I'd like like to have classes Graph and Node, and I want that for every Graph type, there is a corresponding Node ...
11
votes
1
answer
3k
views
EBNF to Scala parser combinator
I have the following EBNF that I want to parse:
PostfixExp -> PrimaryExp ( "[" Exp "]"
| . id "(" ExpList ")"
| . length )*
...
6
votes
1
answer
842
views
Factory methods for implementations of Java interfaces wrapped with Scala implicits?
I'm using Scala implicits to define a rich wrapper for a Java interface:
class RichThing { def richStuff: Unit = {} }
In the companion object I define the implicit conversion and an apply factory ...
21
votes
3
answers
2k
views
Are there scala-like mixins for C++?
Scala Mixins