emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] trunk r114390: * emacs-lisp/eieio.el (class-parent): D


From: Glenn Morris
Subject: Re: [Emacs-diffs] trunk r114390: * emacs-lisp/eieio.el (class-parent): Don't use defalias with macros.
Date: Thu, 19 Sep 2013 12:06:39 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Stefan Monnier wrote:

>> +    * emacs-lisp/eieio.el (class-parent): Don't use defalias with macros.
>
> Why not?

Because it didn't work.

(defvar foo-var 0)

(defmacro foo-mac ()
  '(setq foo-var (1+ foo-var)))

(define-obsolete-function-alias 'old-mac #'foo-mac "24.4")

(defun foo-fails ()
  (old-mac))

(defun foo-works ()
  (foo-mac))


Compile:
foo.el:13:4:Warning: the function `foo-mac' is not known to be defined.

Load compiled version:
(foo-fails) ; -> (invalid-function old-mac)


Also, neither version warns that old-mac is obsolete.

I see now that

(eval-and-compile
  (define-obsolete-function-alias 'old-mac #'foo-mac "24.4"))

works. So maybe that should happen automatically at top-level.




reply via email to

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