Structures (GCL SI Manual)

Next: Iteration and Tests, Previous: Operating System, Up: Top [Contents][Index]

## 10 Structures

Macro: DEFSTRUCT

  Package:LISP

  Syntax:

      (defstruct
               {name | (name {:conc-name | (:conc-name prefix-string) |
                              :constructor | (:constructor symbol [lambda-list]) |
                              :copier | (:copier symbol) |
                              :predicate | (:predicate symbol) |
                              (:include symbol) |
                              (:print-function function) |
                              (:type {vector | (vector type) | list}) |
                              :named | (:static { nil | t})
                              (:initial-offset number)}*)}
               [doc]
               {slot-name |
                (slot-name [default-value-form] {:type type | :read-only flag}*) }*
               )

  Defines a structure. The doc-string DOC, if supplied, is saved as a STRUCTURE doc and can be retrieved by (documentation ’NAME ’structure). STATIC is gcl specific and makes the body non relocatable.

  See the files misc/rusage.lsp misc/cstruct.lsp, for examples of making a lisp structure correspond to a C structure.

Function: HELP (&optional symbol)

  Package:LISP

  GCL specific: Prints the documentation associated with SYMBOL. With no argument, this function prints the greeting message to GCL beginners.