Comment 0 for bug 309074

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

    (reported by Bruno Haible)
  ANSI CL is silent on this, but the MOP's specification of ENSURE-GENERIC-FUNCTION says:
   "The remaining arguments are the complete set of keyword arguments
    received by ENSURE-GENERIC-FUNCTION."
  and the spec of ENSURE-GENERIC-FUNCTION-USING-CLASS:
   ":GENERIC-FUNCTION-CLASS - a class metaobject or a class name. If it is not
    supplied, it defaults to the class named STANDARD-GENERIC-FUNCTION."
  This is not the case in SBCL. Test case:
   (defclass my-generic-function (standard-generic-function)
     ()
     (:metaclass sb-pcl:funcallable-standard-class))
   (setf (fdefinition 'foo1)
         (make-instance 'my-generic-function :name 'foo1))
   (ensure-generic-function 'foo1
     :generic-function-class (find-class 'standard-generic-function))
   (class-of #'foo1)
   ; => #<SB-MOP:FUNCALLABLE-STANDARD-CLASS STANDARD-GENERIC-FUNCTION>
   (setf (fdefinition 'foo2)
         (make-instance 'my-generic-function :name 'foo2))
   (ensure-generic-function 'foo2)
   (class-of #'foo2)
  Expected: #<SB-MOP:FUNCALLABLE-STANDARD-CLASS STANDARD-GENERIC-FUNCTION>
  Got: #<SB-MOP:FUNCALLABLE-STANDARD-CLASS MY-GENERIC-FUNCTION>