-;;; The original motiviation for this function was to deal with the bug in
-;;; the Genera compiler that prevents lambda expressions in top-level forms
-;;; other than DEFUN from being compiled.
-;;;
-;;; Now this function is used to grab other functionality as well. This
-;;; includes:
-;;; - Preventing the grouping of top-level forms. For example, a
-;;; DEFCLASS followed by a DEFMETHOD may not want to be grouped
-;;; into the same top-level form.
-;;; - Telling the programming environment what the pretty version
-;;; of the name of this form is. This is used by WARN.
-;;;
-;;; FIXME: It's not clear that this adds value any more. Couldn't
-;;; we just use EVAL-WHEN?
-(defun make-top-level-form (name times form)
- (flet ((definition-name ()
- (if (and (listp name)
- (memq (car name)
- '(defmethod defclass class
- method method-combination)))
- (format nil "~A~{ ~S~}"
- (capitalize-words (car name) ()) (cdr name))
- (format nil "~S" name))))
- ;; FIXME: It appears that we're just consing up a string and then
- ;; throwing it away?!
- (definition-name)
- (if (or (member 'compile times)
- (member ':compile-toplevel times))
- `(eval-when ,times ,form)
- form)))
-
-(defun make-progn (&rest forms)
- (let ((progn-form nil))
- (labels ((collect-forms (forms)
- (unless (null forms)
- (collect-forms (cdr forms))
- (if (and (listp (car forms))
- (eq (caar forms) 'progn))
- (collect-forms (cdar forms))
- (push (car forms) progn-form)))))
- (collect-forms forms)
- (cons 'progn progn-form))))
-\f
-;;; Like the DEFMETHOD macro, the expansion of the DEFCLASS macro is fixed.
-;;; DEFCLASS always expands into a call to LOAD-DEFCLASS. Until the meta-
-;;; braid is set up, LOAD-DEFCLASS has a special definition which simply
-;;; collects all class definitions up, when the metabraid is initialized it
-;;; is done from those class definitions.
-;;;
-;;; After the metabraid has been setup, and the protocol for defining classes
-;;; has been defined, the real definition of LOAD-DEFCLASS is installed by the
-;;; file defclass.lisp
-(defmacro defclass (name direct-superclasses direct-slots &rest options)
- (declare (indentation 2 4 3 1))
- (expand-defclass name direct-superclasses direct-slots options))
-
-(defun expand-defclass (name supers slots options)
- (declare (special *defclass-times* *boot-state* *the-class-structure-class*))
- (setq supers (copy-tree supers)
- slots (copy-tree slots)
- options (copy-tree options))
- (let ((metaclass 'standard-class))
- (dolist (option options)
- (if (not (listp option))
+;;; After the metabraid has been setup, and the protocol for defining
+;;; classes has been defined, the real definition of LOAD-DEFCLASS is
+;;; installed by the file std-class.lisp
+(defmacro defclass (name %direct-superclasses %direct-slots &rest %options)
+ (let ((supers (copy-tree %direct-superclasses))
+ (slots (copy-tree %direct-slots))
+ (options (copy-tree %options)))
+ (let ((metaclass 'standard-class))
+ (dolist (option options)
+ (if (not (listp option))