Anonymous methods in general lisp
I want to store a generic function as a variable:
(defvar *gf* (make-instance 'standard-generic-function)
But when adding a method, I have to define myself call-next-method
and next-method-p
:
(add-method *gf*
(make-instane 'standard-method
:function (lambda (args next-methods)
(flet ((call-next-method () ...)
(next-method-p () ...))
(apply (lambda () ...) args)))))
How do I call the method for the definition call-next-method
? Is there an easier way to do this?
+3
source to share
1 answer
See MAKE-METHOD-LAMBDA .
If you google for this, you will find various information about the function. For example MAKE-METHOD-LAMBDA is considered harmful .
+2
source to share