On this page:
require
provide
define-class
set-field!
super
implements
constructor
this
fields
define/ public
define/ private
new
field
send
define-interface
Version: 5.3.0.1

6 Class 4

 #lang class/4

(require module-name ...)
Imports all the modules named module-names.

(provide id ...)
Makes all of the ids available to other modules.

(define-class class-name
  super-spec
  implements-spec
  fields-spec
  constructor-spec
  method-spec ...)
 
super-spec = 
  | (super super-name)
     
implements-spec = 
  | (implements interface-name ...)
     
fields-spec = 
  | (fields field-name ...)
     
constructor-spec = 
  | (constructor (arg ...) body ...)
     
method-spec = 
(define/public (method-name arg ...)
  body)
  | 
(define/private (method-name arg ...)
  body)
The same as in class/3, however overriding is supported.

(set-field! f e)
Changes the value of field f to be the result of e.

(super class-or-interface-name)
(implements interface-name ...)
(constructor (args ...) body)

this
(fields id ...)
(define/public (method-name id ...) body)
(define/private (method-name id ...) body)
(new class-name arg ...)
(field field-name)
(send object message arg ...)
These have the same meaning as in class/0.

(define-interface interface-name
  (super super-interface) ...
  (method-name ...))
This has the same meaning as in class/1.

}