dave08
07/21/2024, 3:45 PMList(3) { ... }
but there's no Set(3) { ... }
... are there any plans for that? Or maybe this is on purpose?ephemient
07/21/2024, 5:32 PM(index: Int) -> T
block wouldn't feel natural, but a () -> T
wouldn't work without mutability eitherephemient
07/21/2024, 5:33 PMbuildSet { repeat(3) { add(...) } }
Ayfri
07/21/2024, 6:26 PMCLOVIS
07/22/2024, 4:07 PMList()
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.ephemient
07/22/2024, 6:29 PM