Permalink
Browse files

Fix plot to use immutable constructors.

  • Loading branch information...
1 parent 8db45eb commit 86a976531c7f11144ad9e95e7dffeae8e13a2b81 @takikawa takikawa committed May 2, 2012
Showing with 3 additions and 9 deletions.
  1. +3 −9 collects/plot/common/draw.rkt
@@ -71,21 +71,15 @@
;; Returns an immutable instance of color%. Immutable colors are faster because they don't have to
;; have immutable copies made when they're used in a dc.
(define (make-color% r g b)
- (define color (make-object color% r g b))
- (send color set-immutable)
- color)
+ (make-immutable-color r g b))
;; Returns an immutable instance of pen%. Same reasoning as for make-color%.
(define (make-pen% r g b w s)
- (define pen (make-object pen% (make-color% r g b) w s))
- (send pen set-immutable)
- pen)
+ (make-immutable-pen (make-color% r g b) w s))
;; Returns an immutable instance of brush%. Same reasoning as for make-color%.
(define (make-brush% r g b s)
- (define brush (make-object brush% (make-color% r g b) s))
- (send brush set-immutable)
- brush)
+ (make-immutable-brush (make-color% r g b) s))
(define (color%? c) (is-a? c color%))

0 comments on commit 86a9765

Please sign in to comment.