help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EIEIO defmethod broken if symbol already bound?


From: Wilfred Hughes
Subject: EIEIO defmethod broken if symbol already bound?
Date: Sat, 18 May 2013 16:10:36 +0100

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 via email to

[Prev in Thread] Current Thread [Next in Thread]