Why should fonts and colors be mutable?
> On Apr 11, 2017, at 10:41 PM, WarGrey Gyoudmon Ju <[email protected]> > wrote: > > This is a little awkward, there are lots of simple classes defined in > racket/draw, font%, color%, pen%, brush% and so on. They just hold a group of > plain data, hence opportunities to be inspected easily. However by default > all classes are opaque, the easiest (and perhaps unique) way to handle this > is to inherit them and implement the `printable<%>` or `writable<%>`. > > Despite the wordy code and wasting little runtime space, the major problem is > all those classes hide their (set-immutable) methods, even worse, the > immutability is checked through the private field. As a consequence, > subclasses of Pen% and Brush% copy color instances every time to make them > immutable (and opaque) again... > > So is it okay to open that interface? > Besides, With a long term plan, I want to improve the font infrastructure, > meanwhile maybe font% also should provide a (get-handler) or (get-desc). > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

