From: Nicolas C. <war...@fr...> - 2003-04-15 04:34:07
|
> - Now using user defined resizing functions. Surprisingly, this actually > cleaned up the code. Two default resizing functions are supplied- > exponential, which doubles the array size when the number of used elements > is greater than the array size, and halves the array size when the number > of used elements is less the 1/4th the array size (to help prevent > thrashing), and stepping, which adds or subtracts a given step size. > > Resizers are applied as optional arguments- generally the default is > exponential. So you can just do: > make len null > to get the exponential resizer, or: > make ~resizer:(step_resizer 10) len null > to get the stepwise resizer, or: > make ~resizer:my_resizer len null > to use your own resizer. Excellent, but since this is an "advanced feature", I suggest that you move the resizers to the end of the mli, so they will appear at the end of the documentation. > - The .mli file now has doc comments! Yay! The .ml file still needs to > be commented. Does it really needs ? I don't especially like comments in source files, they are only needed when you're doing something very difficult to understand... > - Length is the length of the actual underlying storage array, used is the > number of elements in that array actually being used. I've decided on > that nomenclature, and started sticking by it. Let me disagree on it :) Since users are used to use the "length" keyword for both Array and List, it would be better to have "length" being the number of elements and "size" being the underlying structure size. Last thing : renaming Xarray to Vector ? BTW, I'm currently writting the "Enum" module (which is the "iterator" I have been talking about) and it will be done soon. Nicolas Cannasse |