Frank Buss <[EMAIL PROTECTED]> writes: > > Jeff Caldwell wrote: > > > I'm just wondering why it's worthwhile to lose the > > type information on points and colors, replacing them with > > arrays? > > It is easier to create it and to pass it to functions than with the SDL > low-level structs, because you have to remember when to delete it. And since > they are some kind of "value" objects (like a number or a string), this is > difficult when passing it around to other functions. The Lisp GC does a > better job for this kind of things
To add to this, passing rectangles and colors as Vectors may actually provide increased performance. CFFI calls are quite expensive, so performing four CFFI calls to read the X, Y, W, H from the SDL_rect, performing a calculation (e.g. a move) and then performing another four CFFI calls to write these values back to the SDL _rect is more expensive than performing all calculations on a Lisp Vector and then converting the Vector to an SDL_rect at the end of the 'pipeline'. - Luke _______________________________________________ application-builder mailing list [email protected] http://www.lispniks.com/mailman/listinfo/application-builder
