all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 'head' specializer for cl-defmethod?
@ 2015-07-28 12:06 Stephen Leake
  2015-07-28 20:39 ` Dmitry Gutov
  2015-07-29  0:01 ` Stefan Monnier
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Leake @ 2015-07-28 12:06 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-29  0:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-28 12:06 'head' specializer for cl-defmethod? Stephen Leake
2015-07-28 20:39 ` Dmitry Gutov
2015-07-29  0:01 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.