From: Brian H. <bh...@sp...> - 2003-04-15 15:37:21
|
I think this was meant for the list as a whole, not just me (apologies if I'm wrong). On Tue, 15 Apr 2003, Nicolas Cannasse wrote: > > - Note that Array.append appends two whole arrays, as does List.append. > > So I changed the name to append_element, and wrote an append which appends > > an xarray. Added a sub function. > > Uh ! skipped this one, sorry. > what about append_element => add ? > shorter, explicit. Add works. Didn't think of it. > > > - Added a copy function. A set_length function was already in the API > > (changed it's name to set_length not set_len). set_length now explicitly > > sets the array length to the given length, without calling the resizer. > > so you're agreeing here that "length" is the number of elements, and not the > size of the data structure :) Yes. I like length/size instead of used/length. Although that means the above function is really set_size, not set_length. The original idea was that set_size and blit together would allow for the efficient implementation of large inserts- that you could implement insert_array or insert_tree by 1) calling set_size to make sure there was enough space for the insert 2) use blit to move the extra elements out of the way 3) repeatedly call set to put the elements in the array Hey, it seemed like a good idea at the time... With your Enum package, it starts looking a lot less necessary. Blit is probably still a good idea, but set_size does raise a number of issues which are probably best left unraised. All you need to do is implement efficient add/insert_enum functions, and you get the same capabilities. > > Nicolas Cannasse > |