Created
April 1, 2016 13:44
-
-
Save anonymous/d688be81db7b81d9705038c8860120ec to your computer and use it in GitHub Desktop.
Kotlin and Scala
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
== Kotlin | |
class T { | |
fun t(): Unit { | |
val double = { x:Int -> x * 2 } | |
listOf(1,2).map { x -> x * 2 }.map{ it + 1 }.map( double ) | |
} | |
} | |
creates | |
T$t$double$1.class | |
T.class | |
== Scala | |
class T { | |
def t(): Unit = { | |
val double = (x: Int) => x + 1 | |
List(1, 2).map { x => x * 2 }.map { _ + 1}.map(double) | |
} | |
} | |
creates | |
T$$anonfun$1.class | |
T$$anonfun$t$1.class | |
T$$anonfun$t$2.class | |
T.class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since 2.11.8 you can enable an experimental mode to use Java8 lambda functions ...