Specializing for primitive types

One interesting feature that was added to Scala in version 2.8 is specialization, using the @specialized annotation. First, a little background information. Generics in Java and the JVM, and consequently also in Scala, are implemented by using type erasure. That means that if you have an instance of a generic class, for example List[String], then …

Continue reading ‘Specializing for primitive types’ »