;;; -*- Mode: Lisp; Syntax: ZL; Package: USER; Base: 10 -*- ;(DEFMACRO DEFSTRUCT (OPTIONS &BODY ITEMS) ; "(DEFSTRUCT ( . ) . ) or (DEFSTRUCT . ) ;Options: ; :TYPE defaults to :ARRAY ; other useful types include :ARRAY-LEADER :TYPED-ARRAY :FIXNUM-ARRAY :FLONUM-ARRAY ; :LIST :LIST* :TREE ; :CONSTRUCTOR defaults to /"MAKE-/" ; More than one constructor may be specified. The syntax for defining a constructor is ; either: (:CONSTRUCTOR [doc-string]) or (:CONSTRUCTOR [doc-string]) ; If no arglist is supplied, a constructor is defined which takes alternating slotnames ; and values (ie uses &KEY) as arguments and initializes those slots to those values. ; If an arglist is supplied, then the constructor defined will have this as its arglist. ; Meaningful lambda-list-keywords are &OPTIONAL &REST and &AUX. ; Use &AUX to initialize a slot to a value other then the usual default value. ; The first type of constructor behaves differently if :CALLABLE-CONSTRUCTORS is non-NIL. ; See below. ; :DEFAULT-POINTER defaults to empty (if no value given defaults to /"/") ; :CONC-NAME defaults to empty (if no value given defaults to /"-/") ; This what to prepend to the names of slots to obtain the names of the slot-accessor ; functions. ; :SIZE-SYMBOL defaults to empty (if no value given defaults to /"-SIZE/") ; :SIZE-MACRO defaults to empty (if no value given defaults to /"-SIZE/") ; ; (when size-symbol ; (push `(DEFPARAMETER ,size-symbol ; ,(+ (defstruct-description-size) ; (defstruct-type-description-overhead))) ; returns)) ; ; (:size-macro ; (setf (defstruct-description-size-macro) ; (if (defstruct-emptyp val) ; (defstruct-append-symbols name "-SIZE") ; val))) ; (:size-symbol ; (setf (defstruct-description-size-symbol) ; (if (defstruct-emptyp val) ; (defstruct-append-symbols name "-SIZE") ; val))) (defstruct (command-blk (:size-symbol command-blk-size)) a b)