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
--- a/src/library/scala/util/parsing/combinator/Parsers.scala | |
+++ b/src/library/scala/util/parsing/combinator/Parsers.scala | |
@@ -17,31 +17,59 @@ import annotation.migration | |
/** `Parsers` is a component that ''provides'' generic parser combinators. | |
* | |
- * It ''requires'' the type of the elements these parsers should parse | |
+ * There are two abstract members that must be defined in order to | |
+ * produce parsers: the type `Elem` and | |
+ * [[scala.util.parsing.combinator.Parsers.Parser]]. There are helper |
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
scala> def f(x: Any) = x match { | |
| case y: Double => println("Got a Double: "+x) | |
| case _ => println("Whatever") | |
| } | |
f: (x: Any)Unit | |
scala> f(true) | |
Whatever | |
scala> f(1) |
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
// Based on Fantom's word count example here: http://blog.joda.org/2011/11/guide-to-evaluating-fantom.html | |
// I'm commenting the lines that need changing, and leaving a few of them uncommented, | |
// as they are the same | |
// class WordCount { | |
object WordCount { | |
// Void main(Str[] args) { | |
def main(args: Array[String]) { | |
if (args.size != 1) { |
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
dcs@ayanami:~/github/scala (new-master)$ ant dist | |
Buildfile: /home/dcs/github/scala/build.xml | |
[echo] Forking with JVM opts: -Xms1536M -Xmx1536M -Xss1M -XX:MaxPermSize=192M -XX:+UseParallelGC | |
dist: | |
[echo] Forking with JVM opts: -Xms1536M -Xmx1536M -Xss1M -XX:MaxPermSize=192M -XX:+UseParallelGC | |
strap.clean: | |
pack.clean: |
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
quick.lib: | |
[mkdir] Created dir: /home/dcs/github/scala/build/quick/classes/library | |
[javac] Compiling 25 source files to /home/dcs/github/scala/build/quick/classes/library | |
[javac] Compiling 41 source files to /home/dcs/github/scala/build/quick/classes/library | |
[javac] Note: Some input files use unchecked or unsafe operations. | |
[javac] Note: Recompile with -Xlint:unchecked for details. | |
[scalacfork] Compiling 686 files to /home/dcs/github/scala/build/quick/classes/library | |
[scalacfork] error: error while loading Object, class file '/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/rt.jar(java/lang/Object.class)' is broken | |
[scalacfork] (167779022) | |
[scalacfork] one error found |
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
[error] /home/dcs/tmp/my-benchmark/project/Build.scala:16: no `: _*' annotation allowed here | |
[error] (such annotations are only allowed in arguments to *-parameters) | |
[error] lazy val root = Project("root", file(".")) settings(sources := Nil) aggregate(benchProjects: _*) | |
[error] ^ | |
[error] one error found |
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
Relevant declaration: | |
override def projects = root +: benchProjects | |
lazy val root = ( | |
Project("root", file("."), settings = Nil) | |
aggregate(benchProjects map Reference.projectToRef: _*) | |
//settings(sources in Compile := Nil) //, run in Compile <<= inputTask { (argTask: TaskKey[Seq[String]]) => argTask.map(_ => () )}) | |
) | |
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
import sbt._ | |
import Keys._ | |
object MyBuild extends Build { | |
val distPath = "/home/dcs/github/scala/dists" // Set this to your environment | |
override def projects = root +: benchProjects | |
lazy val root = ( | |
Project("root", file("."), settings = Nil) |
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
dcs@ayanami:~/github/GenRegex (master)$ ~/scala-2.7.7.final/bin/scala -deprecation | |
Welcome to Scala version 2.7.7.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> List(1, 2, 3,) | |
<console>:1: warning: Trailing commas have been deprecated | |
List(1, 2, 3,) | |
^ | |
<console>:2: warning: Trailing commas have been deprecated |
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
import collection.mutable.ArrayBuffer | |
import collection.immutable.HashMap | |
object HashMapTest { | |
val random = new util.Random(1234) | |
def time(block: => Unit): Double = { | |
val start = System.nanoTime() | |
block |