Ashutosh Panda
11/19/2019, 4:50 PMAnimesh Sahu
11/19/2019, 5:50 PMimplementation "com.uchuhimo:konf:0.20.0"
simtel12
11/19/2019, 6:32 PMMikael
11/19/2019, 6:41 PMKris Wong
11/19/2019, 8:28 PMBen Piatt
11/19/2019, 9:21 PME.Kisaragi
11/20/2019, 3:17 AMLulu
11/20/2019, 5:36 AMViktor Qvarfordt
11/20/2019, 10:02 AMFudge
11/20/2019, 11:09 AMisInitialized
? Is it just checking some flag, or is it some expensive reflective operation, maybe it allocates objects?LeoColman
11/20/2019, 4:14 PMryn1x
11/20/2019, 4:49 PMisConnected.onChange {
timer.scheduleAtFixedRate(timerTask, 0, period)
// unsubscsibe
}
, where isConnected is a SimpleBooleanPropertyMarko Mitic
11/20/2019, 5:36 PMprivate var mGlucoseState = GlucoseState.NONE
lineHullaballoonatic
11/20/2019, 6:35 PMclass Foo(vararg values: Int) : List<Int> by values.toList() {
fun bar() = "foobar"
}
(listOf(1, 2, 3) as Foo).bar()
Casting is cheaper than conversion, because it doesn't require instantiating a new object, right?Hullaballoonatic
11/20/2019, 11:34 PMtoString
given that it never changes, or should I create a backing field?
class Foo(val str: String) {
override fun toString() = str.reversed()
.repeat(1000)
.trim()
.otherStuff()
}
Ky Leggiero
11/20/2019, 11:57 PMcom.android.tools.idea.gradle.project.sync.ng.NewGradleSyncNotSupportedException: New Gradle Sync is not supported due to containing Kotlin modules
Daniele Segato
11/21/2019, 7:06 AMval x = SomeInterface { }
Thanks to SAM.
However when i try the same thing on kotlin interface I'm forced to create an anonymous class:
val x = object : SomeInterface {
fun someMethod() { }
}
If i instead create a type alias for it I can write it without the object ceremony but I've no way of specifying what it is:
typealias SomeInterface = (): Unit
// ...
val x = { }
Yes i know i can do
val x: SomeInterface = { }
But picture this situation:
val x: SomeInterface = when (foo) {
"A" -> { { } }
"B" -> { { } }
}
I need double {
, which is horrible.
I think it would be much better to be able to write;
val x = when (foo) {
"A" -> SomeInterface { }
"B" -> SomeInterface { }
}
Is there a way to do this or a way to improve the previous example?Johan Luttu
11/21/2019, 10:41 AMfun hello() {
println("hello")
}
Bytecode:
public static final void hello();
Code:
0: ldc #7 // String hello
2: astore_0
3: iconst_0
4: istore_1
5: getstatic #13 // Field java/lang/System.out:Ljava/io/PrintStream;
8: aload_0
9: invokevirtual #19 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
12: return
sikri
11/21/2019, 12:42 PMBlundell
11/21/2019, 1:37 PMJamie Taylor
11/21/2019, 4:18 PMMatthias R
11/21/2019, 5:01 PMtrevjones
11/21/2019, 6:05 PMa.mapIndexed { index, value -> value to myList[index] }.toMap()
?alex
11/21/2019, 7:26 PMClass
object for top-level declaration, e.g.:
val x = ???::class.java.getResourceAsStream(...)
?tipsy
11/21/2019, 7:45 PMronnie173
11/21/2019, 8:02 PMrustyrazorblade
11/21/2019, 9:33 PMkeyvalue
val inside this object is a problem:
class Tables(val session: Session) {
val queries = object {
val keyvalue = object {
val insert = prepare("INSERT INTO keyvalue (id, value) values (?, ?)")
val select = prepare("SELECT * from keyvalue WHERE id = ?")
}
val timeseries = object {
val insert = prepare("INSERT INTO timeseries (id, c, data) values (?, ?, ?)")
val selectPartition = prepare("SELECT * from timeseries WHERE id = ?")
val selectPartitionReverse = prepare("SELECT * from timeseries WHERE id = ? order by c DESC")
}
}
}
I’m not able to do essentially this:
tables = Tables(session)
tables.queries.keyvalue
anyone know why?Andy Gibel
11/21/2019, 9:47 PMJohn
11/21/2019, 10:11 PMJohn
11/21/2019, 10:12 PMJohn
11/21/2019, 10:12 PMnfrankel
11/21/2019, 10:16 PMRuckus
11/21/2019, 10:57 PM