Syntax: object
(supers
...
) field-or-method-decl
...
Returns a new instance of an anonymous (inner) class. The syntax is similar to
define-class
.
field-or-method
::=field-decl
|method-decl
field-decl
::= (fname
[[[::]ftype
]finit
])
| (fname
[::ftype
] [option-keyword
option-value
]*)
method-decl
::= ((method-name
formal-arguments
) [[::]rtype
]body
)
Returns a new instance of a unique (anonymous) class. The class inherits from the list of
supers
, where at most one of the elements should be the base class being extended from, and the rest are interfaces.This is roughly equivalent to:
(begin (define-simple-classhname
(supers
...)field-or-method-decl
...) (makehname
))A
field-decl
is as fordefine-class
, except that we also allow an abbreviated syntax. Eachfield-decl
declares a public instance field. Ifftype
is given, it specifies the type of the field. Iffinit
is given, it is an expression whose value becomes the initial value of the field. Thefinit
is evaluated at the same time as theobject
expression is evaluated, in a scope where all thefname
s are visible.A
method-decl
is as fordefine-class
.