[plt-scheme] Changing field values in objects

From: Robert Matovinovic (robert.matovinovic at web.de)
Date: Fri Feb 2 06:27:31 EST 2007

Hi,
I'm nearly desparate, since I'm trying to do a simple thing: changing the
value of a field in an object. I read the help desk thouroghly and tried a
lot, but couldn't find a solution, which to most of you must be obvious. So
here is a bit of sample code. I would appreciate very much if someone can
just add the lines to change the value of the value field:

(define test%
  (class object%
    (init-field (value 0))
    (super-new)
    )
  )
(define t (new test% (value 10)))
(get-field value t)

BTW, is there any tutorial to familiarize oneself easily with the object
system of plt scheme?

Thanks in advance
Robert

_________________________________________
Robert Matovinovic
2 Fenella Drive, Monavale
Harare
Zimbabwe
 
Tel:    +263 (0)4 339 879
Cell:   +263 (0)91 43 66 47
email: robert.matovinovic at web.de



Posted on the users mailing list.