all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Gnu ELPA cl-generic bug?
Date: Tue, 27 Nov 2018 17:17:26 -0700	[thread overview]
Message-ID: <86pnuqjbs9.fsf@stephe-leake.org> (raw)

I'm trying to use the Gnu ELPA package cl-generic to support
cl-defmethod in Emacs 24.5.

I have this set of definitions:

(cl-defstruct wisi-parser
  ;; Separate lists for lexer and parse errors, because lexer errors
  ;; must be repaired first, before parse errors can be repaired. And
  ;; they have different structures.
  lexer-errors
  ;; list of wisi--lexer-errors from last parse.  Can be more than one if
  ;; lexer supports error recovery.
  parse-errors
  ;; List of wisi--parse-errors from last parse. Can be more than one if
  ;; parser supports error recovery.
)

(cl-defgeneric wisi-parse-kill ((parser wisi-parser))
  "Kill any external process associated with parser.")


(cl-defstruct (wisi-elisp-parser (:include wisi-parser))
  actions
  gotos
  next-token
  )

(cl-defmethod wisi-parse-kill ((_parser wisi-elisp-parser))
  nil)


(cl-defstruct (wisi-process--parser (:include wisi-parser))
 ...
 )
 
(cl-defmethod wisi-parse-kill ((parser wisi-process--parser))
  (when (process-live-p (wisi-process--parser-process parser))
    (process-send-string (wisi-process--parser-process parser) wisi-process-parse-quit-cmd)
    (sit-for 1.0)
    (when (process-live-p (wisi-process--parser-process parser))
      (kill-process (wisi-process--parser-process parser)))
    )
  (setf (wisi-process--parser-busy parser) nil))


Whenever one of these 'cl-defmethod' forms is encountered, the byte
compiler issues an error:

Error: Unknown class type wisi-elisp-parser in method parameters

The ELPA package cl-generic defines cl-defgeneric and cl-defmethod,
using eieio defgeneric and defmethod. It does _not_ define cl-defstuct;
that has its normal definition that does not use eieio.

So I suspect the problem is that the eieio class 'wisi-elisp-parser' is
never declared, because 'cl-defstruct' does not call eieio defclass.

Is there a simple fix for this?

-- 
-- Stephe



             reply	other threads:[~2018-11-28  0:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28  0:17 Stephen Leake [this message]
2018-11-28  2:47 ` Gnu ELPA cl-generic bug? Stefan Monnier

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

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

  git send-email \
    --in-reply-to=86pnuqjbs9.fsf@stephe-leake.org \
    --to=stephen_leake@stephe-leake.org \
    --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 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.