[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
check-keyword-arguments
- To: common-lisp-object-system@SAIL.Stanford.EDU
- Subject: check-keyword-arguments
- From: Dick Gabriel <RPG@SAIL.Stanford.EDU>
- Date: 20 May 88 2206 PDT
I think Moon's suggestion for the name FUNCTION-KEYWORD is acceptable.
Here is the corrected code (Having Moon around to read code is
almost as good as having a computer. In fact, it's better because
sometimes he cracks a joke.):
(defmethod make-instance ((class standard-class) &rest initargs)
(setq initargs (default-initargs class initargs))
(let* ((proto (class-prototype class))
(methods
(append
(compute-applicable-methods #'allocate-instance `(,class))
(compute-applicable-methods #'initialize-instance `(,proto))
(compute-applicable-methods #'shared-initialize `(,proto nil)))))
(unless
(subsetp
(let ((keys '()))
(do ((plist initargs (cddr plist)))
((null plist) keys)
(push (car plist) keys)))
(union
(class-slot-initargs class)
(reduce #'union (mapcar #'function-keywords methods))))
(error ...)))
(let ((instance (apply #'allocate-instance class initargs)))
(apply #'initialize-instance instance initargs)
instance))