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

setter problem



Why doesn't this work?


(define-class <foo> (<object>)
  (a)
  (b))
;Value: <foo>

(define foo (make <foo>))
;Value: foo

((setter a) foo "apple")
;Value: "apple"

((setter b) foo "ball")
;Value: "ball"

(define-method see-foo (m (f <foo>))
  (m f))
;Value: see-foo

(see-foo a foo)
;Value: "apple"

(see-foo b foo)
;Value: "ball"


(define-method set-foo (m (f <foo>) i)
  ((setter m) f i))
;Value: set-foo

(set-foo a foo "aardvark")
;Error: unbound variable dylan:setter/m/