Plaster
New
List
Login
common-lisp
default
anonymous
2021.10.25 20:08:37
(c2mop:define-method-combination string-gen (&optional (order ':most-specific-last)) ((around (:around)) (primary (string-gen))) (case order (:most-specific-first) (:most-specific-last (setq primary (reverse primary)))) (let ((form (if (rest primary) `(concatenate 'string ,@(mapcar #'(lambda (method) `(call-method ,method)) primary)) `(call-method ,(first primary))))) (if around `(call-method ,(first around) (,@(rest around)) (make-method ,form)) form))) (defgeneric test3 (x) (:method-combination string-gen :most-specific-last)) (defmethod test3 string-gen ((x request)) "request ") (defmethod test3 string-gen ((x get-request)) "get-request ")
Raw
Annotate
Repaste
Edit