This file contains hidden or 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
subprojects { | |
apply plugin: 'scala' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
compile 'org.scala-lang:scala-library:2.10.1' | |
testCompile 'junit:junit:4.11' |
This file contains hidden or 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
/** | |
* Very low-tech calculator. | |
* | |
* @author Esko Suomi <[email protected]> | |
* @since 26.5.2013 | |
*/ | |
class Calculator { | |
def sum(x:Int, y:Int) = { x + y } | |
} |
This file contains hidden or 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
class Ident(identity:Int) { | |
def ident = identity | |
override def toString = "[id:"+identity+"]" | |
} | |
class Id(identity:Int) { | |
def id = identity | |
override def toString = "[id:"+identity+"]" | |
} |
This file contains hidden or 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 worksheet { | |
def call[T](t:T, s:String) : (T,String) = { (t, s) } | |
//> call: [T](t: T, s: String)(T, String) | |
call("foo", "bar") match { | |
case (x, "bar") => println("found bar") | |
case (x, "baz") => println("found baz") | |
} //> found bar | |
} |
This file contains hidden or 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 controllers | |
import play.navigator._ | |
object nav extends PlayNavigator { | |
if(!Play.isDev()) { | |
val root = namespace("app") { | |
val appRoot = app | |
} |
NewerOlder