This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Test { | |
def main(args: Array[String]) { | |
def process(animal: String, n: Int) = { | |
if (n % 13 == 0 && n > 0) | |
throw new Exception("My " + animal + " hates number " + n) | |
n | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Strange { | |
def fmt(x: Double) = x.formatted("%.2f") | |
def run(f: => Any) = { | |
val n = 100000000L | |
val start = System.nanoTime | |
var i = 0L | |
while (i < n) { | |
f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.strong_links.fawtests | |
import scala.collection._ | |
import scala.collection.generic._ | |
object testCollections extends App { | |
import net.strong_links.core._ | |
def fmt(x: Double) = x.formatted("%.2f") |