Closed chtenb closed 6 months ago
The current vector-init implementation does not allow effects, and thus the following does not compile.
vector-init
val new-vector = vector-init(10, fn(_) ref(Nothing))
Note that the following is not an alternative, since that will only make one ref object and put it in every spot.
val new-vector = vector(10, ref(Nothing))
The following is currently possible, but it is not as efficient.
fun vector-init-e(n : int, g : int -> e a) : e vector<a> list(0, n - 1).map(g).vector
This will be fixed in the next release (currently fixed on the dev branch)
This is released!
The current
vector-init
implementation does not allow effects, and thus the following does not compile.Note that the following is not an alternative, since that will only make one ref object and put it in every spot.
The following is currently possible, but it is not as efficient.