Slackbot
07/22/2019, 12:58 AMchaddha
07/22/2019, 5:21 AMalexsimo
07/22/2019, 9:09 AMSaurav Kothari
07/22/2019, 12:36 PMRuby/Rails
world - Are there any scaffold generators available for Kotlin? Essentially something that will generate a model and database migration for a specified schema?runjorel
07/22/2019, 6:58 PM@JvmDefault
annotation. When try to add the compiler flag -Xjvm-default=enable
into tasks.withType<KotlinCompile> { kotlinOptions { ..
(Gradle Kotlin DSL) it seems to have no effect, and I still get a compiler warning saying I need to have that compiler flag turned on. Is there some where else this flag needs to be set?iex
07/23/2019, 11:24 AMjishindev
07/23/2019, 12:22 PMlazy
in functionality but resettable?rook
07/23/2019, 5:40 PMilya.gorbunov
07/23/2019, 5:51 PMkotlinx.collections.immutable
library — 0.2
Thanks to the great effort of @Abduqodiri Qurbonzoda [JB] we now have modern and efficient implementations of persistent collections rewritten from scratch. That allowed us to improve performance characteristics of many collection operations. See more details in the changelog: https://github.com/Kotlin/kotlinx.collections.immutable/releases/tag/v0.2
Another notable change is that we have split each collection interface there into two parts: an ImmutableCollection
that merely extends a read-only Collection
and adds a contract of immutability on top of it, and a PersistentCollection
that additionally provides modification operations and builders.
We encourage you to try it and share your feedback, but note that the library is still pre-release, so the API and implementations can change in future.
Currently this library is provided only for JVM, but our next short term plan is turning it into a multiplatform one.mathew murphy
07/23/2019, 7:39 PMmathew murphy
07/23/2019, 7:40 PMSha Sha Chu
07/23/2019, 9:07 PMktlint
(or even if you're not), please take a moment to fill out our user survey to help us better support the community: https://forms.gle/8JSWu1bchiWkrWm76bbaldino
07/23/2019, 9:58 PMis
style check when the type is erased (and i can't use reified
)? is it to take in a KClass
as an arg and do something like: fun<T> matches(value: KClass<V>): Boolean = Class::class.java.kotlin == value
and call it via matches(MyClass::class.java.kotlin)
?iex
07/24/2019, 12:02 PM((--.*)?)
(so ()?
to make it optional and wrap in a new ()
to capture) but that doesn't capture it eitherIfvwm
07/24/2019, 12:10 PMCan
07/24/2019, 1:40 PMLiam Humphreys
07/24/2019, 1:55 PMmathew murphy
07/24/2019, 6:10 PM"${var1}${var2}"
and var1 + var2
for string construction?laht
07/24/2019, 8:21 PMBrandon Ward
07/24/2019, 8:41 PM@DslMarker
scope verification?
See attached example.
In case you need a use case to justify my question, my global helper is just something that can supply resources as strings, and it makes sense to be able to do that at various layers of the DSL without needing to repeat the globalHelper
declaration, but at the same time, other functions not marked as global should have their scope enforced by the compiler so that it helps people use the DSL.turansky
07/24/2019, 9:57 PMpaulex
07/25/2019, 12:21 AMBig Chungus
07/25/2019, 12:47 AMNikolai
07/25/2019, 4:37 AMSlackbot
07/25/2019, 5:11 AMbartvh
07/25/2019, 10:43 AMfun doStuffWith(res: SomeResource) {
// res will and MUST be released soon after this function returns
run {
// this is ok, run invokes the lambda immediately
res.doStuff()
}
foo {
// this will throw because I overlooked that foo invokes its lambda argument some time later, when res has been released
res.doStuff()
}
}
Do you think it would be possible in any way to make this usage a compile time error? Or to give a runtime exception earlier than in doStuff
.
Generally speaking, I'd want to prevent some object from being (accidentally) captured by a lambda that is not invoked immediately.
I don't think it's possible, especially not while still allowing the usage in run
, but I'm interested in your ideas.
Both SomeResource
and foo
are under my control.Hamza
07/25/2019, 12:22 PMDmitry Kandalov
07/25/2019, 2:33 PMpublic
?Hamza
07/25/2019, 4:02 PMGunslingor
07/25/2019, 5:32 PM