From: William D. N. <wne...@cs...> - 2003-05-29 16:18:53
|
I currently need some of the DynArrays that I'm working with to have the ability to expand to a given size without adding a series of elements onto the end of the array (I have a situation where I need to expand the size of the array to fit the data I will be adding, but I might be adding the elements out of order, so I can't just call DynArray.add). Now, I can easily do this externally with a call to make and then blit (or append if the DynArray is a non-mutable record field or class member), or I could add it to my local copy of the DynArray module itself via something like: let expand darr new_length = if new_length > darr.length then changelength darr (new_length - darr.length) and adding the appropriate blurb to the interface. I'm just wondering if anyone else thinks this would be useful enough to add to the DynArray module proper... Discuss. William D. Neumann --- "Well I could be a genius, if I just put my mind to it. And I...I could do anything, if only I could get 'round to it. Oh we were brought up on the space-race, now they expect you to clean toilets. When you've seen how big the world is, how can you make do with this? If you want me, I'll be sleeping in - sleeping in throughout these glory days." -- Jarvis Cocker |