chiark / gitweb /
lib/keyword.c (kw_parseempty): Use correct variable scanning `kwval' list.
[sod] / src / utilities.lisp
index 82a387b5fa34e1e340a07aa61a4b96e41ca813cc..9ff9daf4a2119e73db2be58ae50d3f55aa35dfbc 100644 (file)
@@ -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))