[MLton] MLton.Vector.create

Wesley W. Terpstra wesley@terpstra.ca
Tue, 28 Mar 2006 19:40:27 +0200


On Mar 28, 2006, at 7:04 PM, Stephen Weeks wrote:
> There is a weakness in the basis library with regard to directly
> creating vectors.  Vector.tabulate is useful in some situations, but
> often one needs something more flexible.  In the basis, if
> Vector.tabulate isn't sufficient, one must resort to creating an array
> and then calling Array.vector, which copies the entire array.

Is this really necessary? Wouldn't a better approach be to allow  
Array.vector to convert the array to a vector in place if there are  
no other references to the original array? This would allow more  
portable code, and benefit more people.