X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/blobdiff_plain/6efaac65345b43de5a1ed615df2e643a3a001560..refs/heads/mdw/progfmt:/src/utilities.lisp diff --git a/src/utilities.lisp b/src/utilities.lisp index 82a387b..9ff9daf 100644 --- a/src/utilities.lisp +++ b/src/utilities.lisp @@ -404,6 +404,17 @@ (defun copy-instance (object &rest initargs) except where overridden by INITARGS." (apply #'copy-instance-using-class (class-of object) object initargs)) +(export 'find-eql-specialized-method) +(defun find-eql-specialized-method (function arg object) + "Return a method defined on FUNCTION whose ARGth argument is + `eql'-specialized on OBJECT." + (find-if (lambda (method) + (let ((spec (nth arg (method-specializers method)))) + (and spec + (typep spec 'eql-specializer) + (eq (eql-specializer-object spec) object)))) + (generic-function-methods function))) + (export '(generic-function-methods method-specializers eql-specializer eql-specializer-object))