| From: Grant Rettke (grettke at acm.org) Date: Sat Sep 29 16:58:42 EDT 2007 |
|
What is wrong with this example?
Why isn't x in scope?
(require (lib "class.ss"))
(define example%
(class* object% ()
(define x 0)
(define y "hello")
(define/public (v-set name value)
(eval `(set! ,name ,value)))
(define/public (get-x) x)
(define/public (get-y) y)
(super-new)))
(define foo (new example%))
(send foo get-x)
(send foo v-set 'x 10)
=> error set!: cannot set undefined identifier: x
| Posted on the users mailing list. |
|