[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
'head' specializer for cl-defmethod?
From: |
Stephen Leake |
Subject: |
'head' specializer for cl-defmethod? |
Date: |
Tue, 28 Jul 2015 07:06:00 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) |
project.el uses a 'head' specializer in the dispatching argument of
cl-defmethod.
This use of 'head' is not documented other than in the 'Added elements'
section of the cl-generic.el header comment.
I'd like to change the cl-defmethod doc
string to say:
Other than a type, TYPE can also be one of the following:
- `(eql VAL)' - this method will be invoked when the
argument is `eql' to VAL.
- `(head VAL)' - this method will be invoked when the `car' of the
argument is `eql' to VAL
However, that still leaves out the eieio-core specializer `subclass';
I'm not clear how to handle that in the doc string.
I'm guessing the rationale for supporting the 'head' specializer is to
allow using cl-defmethod with objects that are constructed by `cons',
without any cl-defstruct or eieio defclass. That's how it is used in
project.el.
Is there a manual section for cl-defmethod? I don't see one in
doc/misc/cl.texi; perhaps we should add one?
--
-- Stephe
- 'head' specializer for cl-defmethod?,
Stephen Leake <=