all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Wilfred Hughes <me@wilfred.me.uk>
To: help-gnu-emacs@gnu.org
Subject: EIEIO defmethod broken if symbol already bound?
Date: Sat, 18 May 2013 16:10:36 +0100	[thread overview]
Message-ID: <CAFXAjY6zy2_W30RNV154u0-WwbtPcVtCsG01UnM+CBKGW4Knag@mail.gmail.com> (raw)

Hi folks

I think this might be an Emacs bug, but I'm not familiar enough with EIEIO
to be certain. Suppose I want to assign a method foo to a class some-class:

(require 'eieio)

(defclass some-class ()
  ((bar :initform 42)))

(defmethod foo ((s some-class))
  1)

This works fine. However, if the function definition of foo is already
bound to t, it doesn't work:

(require 'eieio)

(defclass some-class ()
  ((bar :initform 42)))

(defalias 'foo 't)

(defmethod foo ((s some-class))
  1) ;; Debugger entered--Lisp error: (void-function foo)

I'm forced to set foo to a function (e.g. (defalias 'foo 'method)) before I
can use (defmethod foo ...). In fact, calling M-x describe-function <RET>
foo <RET> says 'file a bug report'.

Now, I know that (defalias 'foo 't) is silly thing to do. However, I
accidentally ended up in this state when hacking on some code.

Is this a legitimate bug? Emacs 24.2.1.

Thanks :)


             reply	other threads:[~2013-05-18 15:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-18 15:10 Wilfred Hughes [this message]
2013-05-19  9:45 ` EIEIO defmethod broken if symbol already bound? Pierre Lorenzon

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=CAFXAjY6zy2_W30RNV154u0-WwbtPcVtCsG01UnM+CBKGW4Knag@mail.gmail.com \
    --to=me@wilfred.me.uk \
    --cc=help-gnu-emacs@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.