Join Slack
Powered by
Is there a particular reason why `Closeable` inter...
# stdlib
t
Tomasz Krakowiak
04/19/2021, 3:19 PM
Is there a particular reason why
Closeable
interface and
use
extension is not in the common stdlib? Thread in Slack Conversation
e
ephemient
04/19/2021, 3:28 PM
java.lang.AutoCloseable was added in Java 7, with
java.io
.Closeable retrofitted to extend it. stdlib is compatible back to Java 6, so
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/use.html
can only be in stdlib-jdk7.
ephemient
04/19/2021, 3:31 PM
as for the
kotlin.io
.[
java.io
.Closeable].use, dunno. it does seem useful, various multi-platform projects have defined their own (e.g.
https://github.com/square/okio/blob/master/okio/src/commonMain/kotlin/okio/-CommonPlatform.kt#L36
)
6
Views
Open in Slack
Previous
Next