Leon Brocard wrote: > Leopold Toetsch sent the following bits through the ether: > > >>So I rewrote the base routines almost from scratch and have currently a >>file named list.c >> > > I for one am confused as to the number of array-like classes in > Parrot. What is the difference between list and array? Or intlist? Or > multiarray? Perhaps replacing one of these would be better?
List is by itself not a class, but the working engine, managing all the array related functions (indexed access, push/pop/shift/unshift ...) On top of this there will be the *array classes, providing only a wrapper for setting the wanted data_type and calling the appropriate function in list.c. - array.pmc does strict checkin of array dimensions, PMC* data - perarray.pmc does autogrow arrays, PMC *data - multiarray will just recalc the array index and call list's assign/get - intlist.pmc stores packed int's Currently array, multiarray and intlist have all there own buffer management. This will all be replaced (for intlist.c s. remarks at the first announcement) by functions in list.c. When we come to packed arrays, it would be simpler, to extend the "new ..array" parameter to take a type, then to provide byte_array, int_array and so on. The "new .Array, size" syntax may not be enough, e.g. to discern an array from taking a (ptr*) from one taking an int. > Leon leo