scala-2.8 Questions

4

Solved

I want a convenient way to generate an Iterable, given a initial object and a function to produce the next object from the current one, that consumes O(1) memory (i.e., it doesn't cache old results...
Editor asked 24/9, 2010 at 3:44

2

Solved

I've got a trait that looks like this (some further information can be found at this related question by myself although I don't think, it's needed for this question) trait Extractor[-A,+B] { def...
Lehrer asked 15/9, 2010 at 9:18

1

I'm looking for something akin to JodaTime or JSR 310 for Scala that leverages nice Scala features such as operator overloading and doesn't rely on implicit conversions (I have an irrational ...
Workout asked 18/5, 2010 at 11:25

1

why the methods transform (in-place mutation version of map) and retain (in-place mutation version of filter) are defined on only mutable.Map but not on mutable.Buffer and mutable.Set? shouldnt all...
Celtic asked 14/9, 2010 at 5:53

1

Solved

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 pret...
Python asked 13/9, 2010 at 13:16

4

Solved

Just wondering if this is possible. What I would actually like to do is check and possibly modify one of the arguments before it is stored as a val. Alternatively, I could use an overload and make...
Vitellin asked 18/4, 2010 at 3:11

1

Solved

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 ...
Vivacity asked 7/9, 2010 at 16:53

2

Solved

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 possibl...
Tanana asked 3/9, 2010 at 1:56

3

Solved

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 t...
Brocky asked 17/8, 2010 at 19:47

2

Solved

I saw this thread: 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 sugges...
Sepia asked 9/8, 2010 at 22:44

2

Solved

In my app, I'm filtering a file array by various types, like the following: val files:Array[File] = recursiveListFiles(file) .filter(!_.toString.endsWith("png")) .filter(!_.toString.endsWith("gi...
Dishonorable asked 4/8, 2010 at 22:4

1

Solved

I want to write a implicit conversion of Tuple2[A,B] to Seq[C] where C is super type of both A and B. My first try as following: implicit def t2seq[A,B,C](t: (A,B))(implicit env: (A,B) <:< (...
Geochemistry asked 2/8, 2010 at 16:40

1

Solved

looks like when scala 2.8.0 is out, we can use nested @annotations in our persistence layers. But how? Can anyone please transform this from java to scala? Thanks. @NamedQueries({ @NamedQuery(name...
Brume asked 31/7, 2010 at 1:48

3

Solved

EDIT: Rewrote the question. Added bounty as its important for me. The final hint with which i can get findByAttributes to work (without reimplementing it in subclasses) will get my points. In my a...
Fantast asked 22/7, 2010 at 11:4

2

Solved

I'm attempting to create an infinite stream of strings from readLine calls: import java.io.{BufferedReader, InputStreamReader} val in = new BufferedReader(new InputStreamReader(System in)) val inp...
Amadavat asked 22/7, 2010 at 6:11

1

I'm trying to use various Scala implementations of C#-like yield return (i.e. this one) with "for" -constructions such as: private def permutations[T](s: Vector[T]) = { def swap(i: Int, j: Int) {...
Medieval asked 19/7, 2010 at 9:23

3

Solved

In my Scala function, i'm traversing a Java ArrayCollection, extracting specific elements which should form a new collection. At the end, it has to be a Java-ArrayList again, because i'm interactin...
Paring asked 20/7, 2010 at 11:52

4

Solved

I need iterate through a List but circular way. I need too add new elements to the list and iterate over all elements (olds and news elements), How I do it? Is there any data structure for them?
Hydrokinetic asked 15/7, 2010 at 13:52

2

Solved

Scala 2.8 was announced yesterday. They highlight among other things "Enhanced actors". What does "actors with daemon-style semantics" mean and where can I find more about that?
Wyly asked 15/7, 2010 at 17:34

2

Solved

I would like to call 'contains' on my Iterables :-)
Brython asked 27/5, 2010 at 23:37

2

Should the following be compiled without needing an explicit type definition on this? def prepList[B >: A](prefix: PlayList[B]) : PlayList[B] = prefix.foldr(this: PlayList[B])((node, suffix) =...
Tumescent asked 28/6, 2010 at 10:38

1

Solved

The Scala compiler can often infer return types for methods, but there are some circumstances where it's required to specify the return type. Recursive methods, for example, require a return type t...
Length asked 27/6, 2010 at 11:33

3

Solved

I just recently encountered the term "Weak Conformance" (in Stack Overflow user retronym's answer to How to set up implicit conversion to allow arithmetic between numeric types?). What is it?
Ravel asked 22/6, 2010 at 14:58

3

Solved

Does anyone know if something like this is possible in Scala: case class Thing(property:String) def f(thing:Thing, prop:String = thing.property) = println(prop) The above code doesn't compile; ...
Basswood asked 22/6, 2010 at 6:25

1

Solved

I want to create a specific generic method in Scala. It takes two parameters. The first is of the type of a generic Java Interface (it's from the JPA criteria query). It currently looks like this: ...
Roswell asked 18/6, 2010 at 10:4

© 2022 - 2024 — McMap. All rights reserved.