Ignore:
Timestamp:
01/15/12 19:51:35 (10 years ago)
Author:
ehuelsmann
Message:

Support for the FUNCTION-KEYWORDS protocol, required to implement
keyword argument verification for effective methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/clos.lisp

    r13779 r13781  
    129129         (apply #',%name args)))))
    130130
     131;;
     132;;  DEFINE PLACE HOLDER FUNCTIONS
     133;;
     134
    131135(define-class->%class-forwarder class-name)
    132136(define-class->%class-forwarder (setf class-name))
     
    156160         generic-function
    157161         args))
     162
     163(defun function-keywords (method)
     164  (%function-keywords method))
    158165
    159166
     
    14201427                 (required-args (getf plist ':required-args)))
    14211428            (%set-gf-required-args gf required-args)
     1429            (%set-gf-optional-args gf (getf plist :optional-args))
    14221430            (when apo-p
    14231431              (setf (generic-function-argument-precedence-order gf)
     
    17581766                                      fast-function)
    17591767  (declare (ignore gf))
    1760   (let ((method (std-allocate-instance +the-standard-method-class+)))
     1768  (let ((method (std-allocate-instance +the-standard-method-class+))
     1769        (analyzed-args (analyze-lambda-list lambda-list))
     1770        )
    17611771    (setf (method-lambda-list method) lambda-list)
    17621772    (setf (method-qualifiers method) qualifiers)
     
    17661776    (%set-method-function method function)
    17671777    (%set-method-fast-function method fast-function)
     1778    (%set-function-keywords method
     1779                            (getf analyzed-args :keywords)
     1780                            (getf analyzed-args :allow-other-keys))
    17681781    method))
    17691782
     
    19281941                        (funcall emfun args)
    19291942                        (slow-method-lookup gf args))))))
     1943;;           (let ((non-key-args (+ number-required
     1944;;                                  (length (gf-optional-args gf))))))
    19301945           #'(lambda (&rest args)
    19311946               (declare (optimize speed))
     
    33293344(defgeneric no-next-method (generic-function method &rest args))
    33303345
    3331 ;; FIXME
    3332 (defgeneric function-keywords (method))
     3346(atomic-defgeneric function-keywords (method)
     3347  (:method ((method standard-method))
     3348    (%function-keywords method)))
    33333349
    33343350
Note: See TracChangeset for help on using the changeset viewer.