example, I have a geometry lib (<https://github.co...
# stdlib
e
example, I have a geometry lib (https://github.com/kotlin-graphics/glm), where I'd like to write
Copy code
val color = Vec4()
val vertexData = floatArrayOf(*color)
a
what about
val vertexData = color.toFloatArray()
with
fun Vec4.toFloatArray() = arrayOf(x, y, z, w)
?
e
that's what I'm doing now
a
what benefits would you get with the spread-operator?
e
1) conciness 2) coherence with stdlib