Thread
#multiplatform
    soywiz

    soywiz

    5 years ago
    Other nice thing I would suggest: Allow to actual implement a header with a default implementation. A possible use case is this one:
    header fun ByteArray.copyRangeTo(srcPos: Int, dst: ByteArray, dstPos: Int, count: Int) {
    	for (n in 0 until count) dst[dstPos + n] = this[srcPos + n]
    }
    Here I provide a generic implementation, that can be improved using System.arraycopy in JVM or the former for JS typed arrays, but as an optimization, not mandatory. So for example I wouldn’t have to implement for Konan at the very beginning and implement it later when optimizing things
    udalov

    udalov

    5 years ago
    Interesting idea! Please report it as a feature request at kotl.in/issue
    soywiz

    soywiz

    5 years ago
    Sorry. Didn’t notice this (I still have issues with slack notifications) I have created the issue already!https://youtrack.jetbrains.com/issue/KT-20427