natpryce
02/29/2016, 1:40 PMnatpryce
02/29/2016, 1:41 PMnatpryce
02/29/2016, 1:42 PMis
clause in a when
expression matches a value and lets a block of code use it as a down-case value of a more concrete type, I’d like to hook my parsers into the when
expression to match a string and use it as a parsed value.natpryce
02/29/2016, 1:43 PMwhen
expression uses operator functions to match and cast using branches of the whenkirillrakhman
02/29/2016, 1:51 PMmaan
02/29/2016, 4:03 PMvar allByDefault: Int? // error: explicit initializer required, default getter and setter implied
kirillrakhman
02/29/2016, 4:10 PMnatpryce
03/01/2016, 12:16 PMclass Banana {
}
val factory : () -> Banana = ::Banana
val newBanana = factory()
kirillrakhman
03/01/2016, 3:21 PMorangy
kirillrakhman
03/01/2016, 3:25 PMorangy
kirillrakhman
03/01/2016, 3:32 PMjkbbwr
03/01/2016, 3:35 PMdzaitsev
03/03/2016, 1:31 PMthomasnield
03/04/2016, 10:02 PMsingleAssign()
delegate as part of the Kotlin standard library? Our implementation is here on the TornadoFX project(https://github.com/edvin/tornadofx/blob/master/src/main/java/tornadofx/Properties.kt#L52:L115). It allows making a property assignable only once and I've found it much more effective than lateinit
since it locks down mutability and threading problems (unless you pass parameters to make it unsynchronized like lazy()
)voddan
03/04/2016, 10:06 PMnotNull
to me. What's the difference?vmironov
03/04/2016, 10:07 PMnotNull
can be assigned multiple timesthomasnield
03/04/2016, 10:07 PMilya.gorbunov
03/04/2016, 10:23 PMinitOnce
delegate is considered under https://youtrack.jetbrains.com/issue/KT-7180. Feel free to upvote.thomasnield
03/05/2016, 12:03 AMmg6maciej
03/07/2016, 12:15 PMfun MyClass?.myFunction() = ...
I was thinking about something like:
class MyClass {
fun ?myFunction() = ...
}
dh44t
03/07/2016, 12:18 PMmg6maciej
03/07/2016, 12:45 PMval myObject: MyClass? = ...
myObject.myFunction()
voddan
03/07/2016, 1:01 PMmg6maciej
03/07/2016, 1:03 PMvoddan
03/07/2016, 1:04 PMvoddan
03/07/2016, 1:04 PMmg6maciej
03/07/2016, 1:04 PMvoddan
03/07/2016, 1:04 PM