RE: GdkRectangle, again



pardon my newbie-like way but...

my only concern with moving from arrays to hashs is that
something like GdkRectangle is used often in screen drawing
and other graphics places where you want things to be fast. Also with something
small like this, its common to have many of them in the application at once
or to create and destroy them quickly for one time uses.
And as I understand arrays are smaller and faster than hashes.

A further notion is that there are other Gdk types just like Rectangle
( GtkPoint, GdkSegment ) that are going to have to be implimented for uses
( line, segment, and polygon drawing routines ), and as keeping an API regular
is always a good idea they'd be implimented the same way as you choose
for GdkRectangle and its using functions. 

Isn't it simple to bless whatever you choose for the underlying structure
and then just have some quick perl wrapper methods of the form ->x for when
you want better accessors than indices? That way you have your clean
interface for when you want the parts of a rectangle, but the c functions
that accept a GdkRectangle argument or return one can just hit the faster
array indices directly. Very simple in xs.


Jason Stillwell






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]