-(defun get-method-function-pv-cell (method-function
- method-args
- &optional pv-table)
- (let ((pv-table (or pv-table (method-function-pv-table method-function))))
- (when pv-table
- (let ((pv-wrappers (pv-wrappers-from-all-args pv-table method-args)))
- (when pv-wrappers
- (pv-table-lookup pv-table pv-wrappers))))))
+;;; this is similar to the above, only not quite. Only called when
+;;; the MOP is heavily involved. Not quite parallel to
+;;; METHOD-FUNCTION-FROM-FAST-METHOD-FUNCTION, because we can close
+;;; over the actual PV-CELL in this case.
+(defun method-function-from-fast-method-call (fmc)
+ (let* ((fmf (fast-method-call-function fmc))
+ (pv-cell (fast-method-call-pv-cell fmc))
+ (arg-info (fast-method-call-arg-info fmc))
+ (nreq (car arg-info))
+ (restp (cdr arg-info)))
+ (lambda (method-args next-methods)
+ (let* ((nm (car next-methods))
+ (nms (cdr next-methods))
+ (nmc (when nm
+ (make-method-call
+ :function (if (std-instance-p nm)
+ (method-function nm)
+ nm)
+ :call-method-args (list nms)))))
+ (if restp
+ (let* ((rest (nthcdr nreq method-args))
+ (args (ldiff method-args rest)))
+ (apply fmf pv-cell nmc (nconc args (list rest))))
+ (apply fmf pv-cell nmc method-args))))))
+
+(defun get-pv-cell (method-args pv-table)
+ (let ((pv-wrappers (pv-wrappers-from-all-args pv-table method-args)))
+ (when pv-wrappers
+ (pv-table-lookup pv-table pv-wrappers))))