karelpeeters
12/29/2017, 3:30 PMmap.entries.forEach { ... }
, you can mutate the the entries within the lambda.karelpeeters
12/29/2017, 3:30 PMmap
was mutable of course.ilya.gorbunov
12/29/2017, 4:25 PMassociate
or associateBy
on map entries:
map.entries.associate { (k, v) -> f(k) to g(v) }
oday
12/30/2017, 12:38 PMclass CurrentConditionsDisplay(
weatherData: WeatherData,
private var temp: Float = 0.0f,
private var humidity: Float = 0.0f,
private var pressure: Float = 0.0f
)
oday
12/30/2017, 12:38 PModay
12/30/2017, 12:39 PModay
12/30/2017, 12:40 PMclass CurrentCOnditionsDisplay
and then initialize them in the constructor, it’s now done in 1 go?poohbar
12/30/2017, 3:58 PMadam-mcneilly
01/02/2018, 2:01 AMcatch (ExceptionA | ExceptionB exc) { }
but the Java -> Kotlin converter ends up putting each one in its own catch block. I just want to make sure that's right.Tristan Wiley
01/02/2018, 2:48 AMjsicotte
01/03/2018, 2:23 AMjsicotte
01/03/2018, 2:24 AMIn pure Kotlin projects, the recommended directory structure is to follow the package structure with
the common root package omitted (e.g. if all the code in the project is in the "org.example.kotlin" package and its
subpackages, files with the "org.example.kotlin" package should be placed directly under the source root, and
files in "org.example.kotlin.foo.bar" should be in the "foo/bar" subdirectory of the source root.
jsicotte
01/03/2018, 2:30 AMorg/example
directories seems to make sense, I am curious where the standard came from. I don't see any discussion around it in the style guide issue tracker. I do see it used in one kotlin project from JetBrains, but not in a larger one like coroutines.cedric
01/03/2018, 2:48 AMcedric
01/03/2018, 2:49 AMjsicotte
01/03/2018, 2:53 AMcedric
01/03/2018, 2:54 AMjsicotte
01/03/2018, 2:54 AMdominik.sittel
01/03/2018, 8:46 AMdominik.sittel
01/03/2018, 8:47 AMdominik.sittel
01/03/2018, 8:48 AMyole
01/03/2018, 9:39 AMbartosz.malkowski
01/04/2018, 9:39 AMbartosz.malkowski
01/04/2018, 9:39 AMandrofox
01/06/2018, 7:51 PMmwerschy
01/06/2018, 8:05 PMopen
or use the kotlin-spring
/ kotlin-allopen
plugins.androfox
01/06/2018, 8:08 PMpoohbar
01/06/2018, 10:49 PMval f: () -> String = fun() {
return "Hello"
}