1 How to Scribble Documentation
2 Scribble Layers
3 @-Reader
4 Structures And Processing
5 Renderer
6 Decoding Text
7 Document Language
8 Document Reader
9 Basic Document Forms
10 Scheme
11 Manual Forms
12 Evaluation and Examples
13 BNF Grammars
14 Cross-Reference Utilities
15 Text Preprocessor
Index
On this page:
defclass
defclass/ title
definterface
definterface/ title
defmixin
defmixin/ title
defconstructor
defconstructor/ make
defconstructor*/ make
defconstructor/ auto-super
defmethod
defmethod*
method
xmethod
Version: 4.0.2

 

11.4 Documenting Classes and Interfaces

(defclass id super (intf-id ...) pre-flow ...)

 

super

 

=

 

super-id

 

 

|

 

(mixin-id super)

Creates documentation for a class id that is a subclass of super and implements each interface intf-id. Each identifier in super (except object%) and intf-id must be documented somewhere via defclass or definterface.

The decoding of the pre-flow sequence should start with general documentation about the class, followed by constructor definition (see defconstructor), and then field and method definitions (see defmethod). In rendered form, the constructor and method specification are indented to visually group them under the class definition.

(defclass/title id super (intf-id ...) pre-flow ...)

Like defclass, also includes a title declaration with the style 'hidden. In addition, the constructor and methods are not left-indented.

This form is normally used to create a section to be rendered on its own HTML. The 'hidden style is used because the definition box serves as a title.

(definterface id (intf-id ...) pre-flow ...)

Like defclass, but for an interfaces. Naturally, pre-flow should not generate a constructor declaration.

(definterface/title id (intf-id ...) pre-flow ...)

Like definterface, but for single-page rendering as in defclass/title.

(defmixin id (domain-id ...) (range-id ...) pre-flow ...)

Like defclass, but for a mixin. Any number of domain-id classes and interfaces are specified for the mixin’s input requires, and any number of result classes and (more likely) interfaces are specified for the range-id. The domain-ids supply inherited methods.

(defmixin/title id (domain-id ...) (range-id ...) pre-flow ...)

Like defmixin, but for single-page rendering as in defclass/title.

(defconstructor (arg-spec ...) pre-flow ...)

 

arg-spec

 

=

 

(arg-id contract-expr-datum)

 

 

|

 

(arg-id contract-expr-datum default-expr)

Like defproc, but for a constructor declaration in the body of defclass, so no return contract is specified. Also, the new-style keyword for each arg-spec is implicit from the arg-id.

(defconstructor/make (arg-spec ...) pre-flow ...)

Like defconstructor, but specifying by-position initialization arguments (for use with make-object) instead of by-name arguments (for use with new).

(defconstructor*/make [(arg-spec ...) ...] pre-flow ...)

Like defconstructor/make, but with multiple constructor patterns analogous defproc*.

(defconstructor/auto-super [(arg-spec ...) ...] pre-flow ...)

Like defconstructor, but the constructor is annotated to indicate that additional initialization arguments are accepted and propagated to the superclass.

(defmethod (id arg-spec ...)

           result-contract-expr-datum

           pre-flow ...)

Like defproc, but for a method within a defclass or definterface body.

(defmethod* ([(id arg-spec ...)

              result-contract-expr-datum] ...)

            pre-flow ...)

Like defproc*, but for a method within a defclass or definterface body.

(method class/intf-id method-id)

Creates a hyperlink to the method named by method-id in the class or interface named by class/intf-id. The hyperlink names the method, only; see also xmethod.

For-label binding information is used with class/intf-id, but not method-id.

(xmethod class/intf-id method-id)

Like method, but the hyperlink shows both the method name and the containing class/interface.