Skip to content

Instantly share code, notes, and snippets.

Created April 1, 2016 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/d688be81db7b81d9705038c8860120ec to your computer and use it in GitHub Desktop.
Save anonymous/d688be81db7b81d9705038c8860120ec to your computer and use it in GitHub Desktop.
Kotlin and Scala
== 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
@nremond
Copy link

nremond commented Apr 1, 2016

Since 2.11.8 you can enable an experimental mode to use Java8 lambda functions ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment