Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soc/ccba45a8425ad9801150c759bfea6977 to your computer and use it in GitHub Desktop.
Save soc/ccba45a8425ad9801150c759bfea6977 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment