Ignore:
Timestamp:
Sep 25, 2004, 9:36:06 PM (16 years ago)
Author:
gb
Message:

DEFCLASS macro: handle :DOCUMENTATION as a single option, if provided.
Don't default superclasses (from Tim Moore.). Pass class name, not class,
in :METACLASS option.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lib/macros.lisp

    r812 r882  
    15881588                                 (typep (cadr option) 'symbol))
    15891589                      (illegal-option option))
    1590                     `(:metaclass (find-class ',(cadr option))))
     1590                    `(:metaclass  ',(cadr option)))
     1591                   (:documentation
     1592                    `(:documentation ',(cadr option)))
    15911593                   (t
    15921594                    (list `',option-name `',(cdr option))))))
     
    16571659                        (duplicate-options slot)
    16581660                        (setq documentation-p t))
    1659                       (setq documentation (require-type (cadr options) 'string)))
     1661                      (setq documentation (cadr options)))
    16601662                     (t
    16611663                      (let* ((pair (or (assq (car options) other-options)
     
    16701672                   ,@(when writers `(:writers ',writers))
    16711673                   ,@(when type-p `(:type ',type))
    1672                    ,@(when documentation `(:documentation ,documentation))
     1674                   ,@(when documentation-p `(:documentation ,documentation))
    16731675                   ,@(mapcan #'(lambda (opt)
    16741676                                 `(',(car opt) ',(cdr opt))) other-options)))))
    1675         (let* ((direct-superclasses (or superclasses '(standard-object)))
     1677        (let* ((direct-superclasses superclasses)
    16761678               (direct-slot-specs (mapcar #'canonicalize-slot-spec slots))
    16771679               (other-options (apply #'append (mapcar #'canonicalize-defclass-option class-options ))))
     
    17281730                        (memq keyword (prog1 option-keywords (push keyword option-keywords))))             
    17291731                   (signal-program-error "Duplicate option: ~s to ~s" keyword 'defgeneric))
    1730                   ((eq keyword :method-name)    ; used by generic-flet
    1731                    (if function-name (bad-option o))
    1732                    (setq function-name (cadr o)))
    17331732                  ((eq keyword :method-combination)
    17341733                   (unless (symbolp (cadr o))
Note: See TracChangeset for help on using the changeset viewer.