1 ;;;; protocol.lisp --- Protocol used by pattern specializers.
3 ;;;; Copyright (C) 2014 Jan Moringen
5 ;;;; Author: Jan Moringen <jmoringe@techfak.uni-bielefeld.de>
7 (cl:in-package #:pattern-specializer)
9 ;;; Pattern specializer protocol
11 (defgeneric specializer-accepts-generalizer-p-using-pattern
12 (generic-function specializer pattern generalizer)
14 "Like SPECIALIZER-ACCEPTS-GENERALIZER-P but with the ability to
15 dispatch on PATTERN."))
17 ;;; Pattern generic function protocol
19 (defgeneric generic-function-specializer-clusters (generic-function)
21 "Return a list of specializer cluster for
22 GENERIC-FUNCTION. Assuming GENERIC-FUNCTION has N required
23 parameters, the returned list is of the following form
25 ((PARAM_1-CLUSTER_1 ... PARAM_1-CLUSTER_M_1)
27 (PARAM_N-CLUSTER_1 ... PARAM_N-CLUSTER_M_N)
29 where each PARAM_I_CLUSTER_J is a sorted list of `pattern-specializer's
31 (SPECIALIZER_1 ... SPECIALIZER_L)
33 such that for an object O
35 SPECIALIZER_I accepts O => SPECIALIZER_K accepts O
39 (defgeneric generic-function-generalizer-makers (generic-function)
43 (defgeneric in-same-cluster-p (generic-function specializer1 specializer2)
45 "Return true if for GENERIC-FUNCTION SPECIALIZER1 and SPECIALIZER2
46 are in the same cluster."))