rattrayalex
06/07/2017, 4:47 PMit
feature of Kotlin? Does it cause problems/confusions?tipsy
06/07/2017, 5:10 PMhetang
06/07/2017, 5:13 PM.let
blocks then you should be careful to use it. For that case we are using unwrap library: https://github.com/importre/kotlin-unwrapkevinmost
06/07/2017, 5:26 PMit
is great if you use it properly. Don't use it in nested or multi-line lambdas. It should only be used when the definition of it
is immediately and unambiguously clearbartektartanus
06/07/2017, 5:50 PMit
equivalent to _
in Scala?kevinmost
06/07/2017, 6:26 PM_
is equivalent to _
in Scala 😆 . If you have a lambda with one parameter, you can choose not to define the param name and it's implicitly named it
strings.map { string -> string.length }
, or you could do strings.map { it.length }
chb0kotlin
06/07/2017, 10:14 PMmap(SomeClass::transformThing)
that sytax obviates the need for a known symbol in a lambdakevinmost
06/07/2017, 10:23 PMmyObject.map { it.foo?.bar }
, or something more complex?bartektartanus
06/08/2017, 5:41 AMstrings.map( _.length )
kevinmost
06/08/2017, 10:35 AM_
meant so many things in Scala https://stackoverflow.com/a/8001065/3204764