unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: emacs-devel@gnu.org
Subject: Help with cl-generic.el, please!
Date: Sun, 19 Mar 2023 11:27:55 +0000	[thread overview]
Message-ID: <ZBbxu5ThSnBXCXmM@ACM> (raw)

Hello, Emacs.

I'm having trouble with cl-generic.el.  I'm constructing a variant
Emacs.

Consider the test function in
..../test/lisp/progmodes/elisp-mode-tests.el:

    (cl-defmethod xref-elisp-generic-implicit-generic (arg1 arg2)
      "Doc string generic implicit-generic default."
      "default for implicit generic"
      (list arg1 arg2)) ; silence byte-compiler

..  When I evaluate this in Emacs, I get a byte-compiled function.
Element 4 of this vector is a doc string "\n\n(fn ARG &rest ARGS)".
This is correct.

When I do the same in my Emacs variant, that element 4 of the function
vector is nil.  This is a bug I'm trying to solve.

I find the complexity of cl-generic.el unfathomable.  I've spent several
days trying to make sense of it, without much success.  I would have
expected to solve the sort of bug I'm faced with in a few hours at most,
but with cl-defmethod and friends, this has already stretched to several
days.  The problem is cl-generic.el is almost entirely undocumented.
The vast bulk of functions in it have no doc string.  There are no
comments explaining what the code does and why.  There is no
documentation of what the internal structures are.  There is no
explanation of terms such as dispatcher, generalizer, specializer, tag,
...., all of which are used in a tighly context dependent way.

I think cl-generic.el needs to be documented.

Back to my bug.  Somewhere in the tree of functions invoked from
cl-defmethod and friends, some function causes element 4 of the function
vector to get set to a doc string.  Would somebody (?Stefan) familiar
with cl-generic.el please identify where in the source code this
happens, so as to help me solve my bug.

Thanks!

-- 
Alan Mackenzie (Nuremberg, Germany).



                 reply	other threads:[~2023-03-19 11:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZBbxu5ThSnBXCXmM@ACM \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).