Questions tagged [scala-2.10]

Version 2.10 of the Scala language for the JVM. Use only if your question is specifically related to features of this version.

This tag is for the 2.10 version of the Scala language. The contents of this version are not yet decided, as it has not yet been released.

Use only if your question is specifically related to features of this version. Just because you are using this version, doesn't mean you need this tag. Use in addition to or instead of this tag.

See for more information.

590 questions
16
votes
3 answers

Scala 2.10 - Octal escape is deprecated - how to do octal idiomatically now?

See https://issues.scala-lang.org/browse/SI-5205 and https://github.com/scala/scala-dist/pull/20 Octal escape value leading 0 has been deprecated from scala and I don't see an idiomatic alternative. How do you deal with octals in scala 2.10 now??…
JasonG
  • 5,794
  • 4
  • 39
  • 67
16
votes
7 answers

Flatten Scala Try

Is there a simple way to flatten a collection of try's to give either a success of the try values, or just the failure? For example: def map(l:List[Int]) = l map { case 4 => Failure(new Exception("failed")) case i => Success(i) } val l1 =…
J Pullar
  • 1,915
  • 2
  • 18
  • 30
16
votes
1 answer

Relation between Akka and scala.actors in 2.10

The Scala 2.10 release notes says this: "Akka Actors now part of the distribution. The original Scala actors are now deprecated." The latest Akka library ("Akka 2.1.0 for Scala 2.10") mentions the following…
teo
  • 1,393
  • 1
  • 15
  • 25
16
votes
1 answer

Any info out there on migrating a Scala 2.9 compiler plugin to 2.10?

I have a Scala 2.9 compiler plugin (source code) and works just fine in 2.9 but does not even compile with 2.10. There are dozens (maybe 100+) of errors all of the same kind such as: [scalac] C:\***.scala:31: error: illegal cyclic reference…
Learner
  • 1,215
  • 1
  • 11
  • 26
15
votes
1 answer

When using Scala futures, will chained callbacks with the same execution context be optimised into synchronous calls?

The new Future in Scala 2.10 uses an execution context for every operation where an action is called asynchronously (including map, filter, etc). Does this mean that every action will always be called individually through the execution context, or…
SoftMemes
  • 5,602
  • 4
  • 32
  • 61
15
votes
3 answers

How to detect Infinity values in Scala?

Scala has Double.isNaN for detecting not-a-number but no Double.isInf for detecting (positive or negative) infinity. Why? I'd like to check whether a parameter is a "real" number (i.e. has a numeric value). Converting it to a string and checking for…
akauppi
  • 17,018
  • 15
  • 95
  • 120
15
votes
1 answer

String interpolation and macro: how to get the StringContext and expression locations

I'm trying to implement a custom string interpolation method with a macro and I need some guidance on using the API. Here is what I want to do: /** expected * LocatedPieces(List(("\nHello ", Place("world"), Position()), …
Eric
  • 15,494
  • 38
  • 61
14
votes
1 answer

Why Transactors have been deprecated in Akka 2.3

On the Migration guide from Akka 2.2.x to 2.3 I noticed the following brief mention: Deprecated STM Support for Agents Agents participating in enclosing STM transaction is a deprecated feature. I googled to find out about the reasons for this…
mdm
  • 3,928
  • 3
  • 27
  • 43
14
votes
4 answers

Creating `**` power operator for Scala?

I quite like the ** syntax for pow, available in many languages (such as Python). Is it possible to introduce this into Scala, without modifying the Scala 'base' code? My attempt at an Int only one: import scala.math.pow implicit class PowerInt(i:…
A T
  • 13,008
  • 21
  • 97
  • 158
13
votes
2 answers

Enabling the macro-paradise Scala compiler plugin in Maven projects

I have the ordinary scala-2.10 macros working in a maven project just by including the scala-reflect.jar library as a dependency in the pom, but what do I need to turn on macro-paradise? I am using scala-2.10 and scala-maven-plugin-3.1.5.
Daniel Mahler
  • 7,653
  • 5
  • 51
  • 90
13
votes
1 answer

How do I set the default number of threads for Scala 2.10 parallel collections?

In Scala before 2.10, I can set the parallelism in the defaultForkJoinPool (as in this answer scala parallel collections degree of parallelism). In Scala 2.10, that API no longer exists. It is well documented that we can set the parallelism on a…
JZeta
  • 153
  • 1
  • 6
13
votes
2 answers

How to use Type calculated in Scala Macro in a reify clause?

I've been working with Scala Macros and have the following code in the macro: val fieldMemberType = fieldMember.typeSignatureIn(objectType) match { case NullaryMethodType(tpe) => tpe case _ =>…
mgonto
  • 6,605
  • 2
  • 29
  • 36
13
votes
2 answers

How to use Scala 2.10 implicit classes

I thought this would be correct usage of the new implicit classes of Scala 2.10: implicit case class IntOps(i: Int) extends AnyVal { def twice = i * 2 } 11.twice Apparently not: :13: error: value twice is not a member of Int …
0__
  • 66,707
  • 21
  • 171
  • 266
12
votes
1 answer

NoClassDefFoundError: org/jetbrains/asm4/ClassReader on IntelliJ IDEA 13.1.4 Build #IU-135.1229

I have following warning: Warning:scalac: Class dependency information may be incomplete! Error parsing generated class /Users/admin/Server_Projects/DatingServer/target/scala-2.10/classes/reactive/Globals.class Error:…
SBotirov
  • 13,872
  • 7
  • 59
  • 81
12
votes
2 answers

Clean solution for dropping into REPL console in the middle of program execution

Is there any working solution for dropping into REPL console with for Scala 2.10? This is mainly for debugging purpose - I want to pause in the middle of execution, and have a REPL console where I can inspect values and test the program's logic…
lolski
  • 16,231
  • 7
  • 34
  • 49