CLIM mail archive


Mutabillity of Clim regions

Hi there.

I have a question concerning the (i)mutabillity of Clim regions.

My application uses some gemoteric reasoning about certain objects.
The CLIM region (prolygon) protocol fits very well to this problems, so I am
thinking about two possiblities:

A)  This objects have a region accessor, whose value is an instance of
    class standard-polygon. I use the region-functions on this instance
    or write some trampoline functions.
    However, the drawback is that for every change in the geometric properties
    (i.e. position, rotation, dimensions) I have to cons a new instance.
    Especially position changes occur quite often.

B)  I make my objects subclasses of class standard-polygon and modify
    the  coordinate-related values each time there is a change in the
    geometric properties. (So position changes dont require consing)
    Thus I make it a mutable object.
    Will this lead to any problems (e.g., I could imagine that some
    implementations of bounding-rectangle for standard-pologon 
    cache their result in the polygon instance)

What approach should I take?

Thanks - Stefan.
Stefan Bernemann                     Tel.: +49-231-9743-139
FhG IML                              Fax:  +49-213-9743-234
Joseph-von-Fraunhofer-Str. 2-4       email:
D44227 Dortmund


Main Index | Thread Index