unrelated: Is there a kotlin `stdlib` cross-platf...
# stdlib
g
unrelated: Is there a kotlin
stdlib
cross-platform implementation of
BitSet
? That is, something that lets me do common bit maniuplations but without a fixed size? The
java.util.BitSet
has all sorts of ugly java (read: old) conventions around cloning, blyeh, i dont like it.
h
BitSet is currently native only and therefore has been marked "obsolete" with Kotlin 1.9.0 – according to the release notes you can keep using obsolete classes, but they'll be replaced in a later release. 🤷‍♂️
🤔 2
g
it has the same gross mutable methods as java does! https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native/-bit-set/and-not.html eeeew.
clearly
BitSet.andNot(r: BitSet): BitSet
is the correct signature
2
i
@groostav If you have ideas how an ideal BitSet type could be designed, please drop them here: https://youtrack.jetbrains.com/issue/KT-55163/BitSet-for-Kotlin-multiplatform-projects
s
I know this is a tad late, however I'm gonna post it anyways korlibs has a class called
BitSet
, however it does not contain methods to allow you to perform binary operations on the bitset, only
set
and
get
. However, if you wish to add those, you could always PR it to them. do note: the documentation for the korlibs libraries are rather lacking. https://docs.korge.org/kds/sets/#BitSet https://dokka.korge.org/kds/com.soywiz.kds/-bit-set/index.html
🍻 1