Skip to content

Commit

Permalink
remove unnecessary define-method-combination
Browse files Browse the repository at this point in the history
  • Loading branch information
defaultxr committed Apr 12, 2024
1 parent d97680d commit 1255e40
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
3 changes: 1 addition & 2 deletions src/patterns/patterns.lisp
Expand Up @@ -274,8 +274,7 @@ See also: `peek', `peek-n', `next', `next-upto-n'"
(defgeneric next (pattern)
(:documentation "Get the next value of a pstream, function, or other object, advancing the pstream forward in the process.
See also: `next-n', `next-upto-n', `peek'")
(:method-combination pattern))
See also: `next-n', `next-upto-n', `peek'"))

(defmethod next ((object t))
object)
Expand Down
24 changes: 0 additions & 24 deletions src/utility.lisp
Expand Up @@ -581,30 +581,6 @@ See also: `all-instruments', `playing-pdefs', `playing-p'"

;;; macros / MOP stuff

(define-method-combination pattern ()
((around (:around))
(before (:before))
(primary () :required t)
(after (:after)))
"Method combination type for patterns; specifically, the `next' function. Similar to the standard CLOS method combination, except that :around methods are called in reverse order, from the least specific to the most specific."
(flet ((call-methods (methods)
(mapcar #'(lambda (method)
`(call-method ,method))
methods)))
(let ((form (if (or before after (rest primary))
`(multiple-value-prog1
(progn ,@(call-methods before)
(call-method ,(first primary)
,(rest primary)))
,@(call-methods (reverse after)))
`(call-method ,(first primary)))))
(if around
(let ((around (reverse around)))
`(call-method ,(first around)
(,@(rest around)
(make-method ,form))))
form))))

(deftype slot-definition-slot () ; FIX: remove in favor of `mutility:find-class-slot' eventually
"Slots of slot definitions. This is primarily used for `find-class-slot'.
Expand Down

0 comments on commit 1255e40

Please sign in to comment.