Function: cl-generic-define-generalizer
cl-generic-define-generalizer is a macro defined in cl-generic.el.gz.
Signature
(cl-generic-define-generalizer NAME PRIORITY TAGCODE-FUNCTION SPECIALIZERS-FUNCTION)
Documentation
Define a new kind of generalizer.
NAME is the name of the variable that will hold it.
PRIORITY defines which generalizer takes precedence.
The catch-all generalizer has priority 0.
Then eql generalizer has priority 100.
TAGCODE-FUNCTION takes as first argument a varname and should return
a chunk of code that computes the tag of the value held in that variable.
Further arguments are reserved for future use.
SPECIALIZERS-FUNCTION takes as first argument a tag value TAG
and should return a list of specializers that match TAG.
Further arguments are reserved for future use.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-generic.el.gz
(defmacro cl-generic-define-generalizer
(name priority tagcode-function specializers-function)
"Define a new kind of generalizer.
NAME is the name of the variable that will hold it.
PRIORITY defines which generalizer takes precedence.
The catch-all generalizer has priority 0.
Then `eql' generalizer has priority 100.
TAGCODE-FUNCTION takes as first argument a varname and should return
a chunk of code that computes the tag of the value held in that variable.
Further arguments are reserved for future use.
SPECIALIZERS-FUNCTION takes as first argument a tag value TAG
and should return a list of specializers that match TAG.
Further arguments are reserved for future use."
(declare (indent 1) (debug (symbolp body)))
`(defconst ,name
(cl-generic-make-generalizer
',name ,priority ,tagcode-function ,specializers-function)))