Not sure if this is the right channel, but it seem...
# stdlib
d
Not sure if this is the right channel, but it seems like even though there's
List(3) { ... }
but there's no
Set(3) { ... }
... are there any plans for that? Or maybe this is on purpose?
e
IMO. sets aren't indexed so a
(index: Int) -> T
block wouldn't feel natural, but a
() -> T
wouldn't work without mutability either
👍🏼 1
you could always
Copy code
buildSet { repeat(3) { add(...) } }
a
Being able to generate a Set with values depending on an incrementing number can still be useful
3
c
List()
exists because it's a useful optimization to pre-allocate the size of the list, I think. Sets are usually not contiguous, so the optimization doesn't exist.
👆 1
e