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

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

bug#27016: possible bug in `defsetf'


From: Michael Heerdegen
Subject: bug#27016: possible bug in `defsetf'
Date: Thu, 25 May 2017 22:26:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

npostavs@users.sourceforge.net writes:

> Oh, I think `eval-when' should be equivalent:
>
>     (eval-when (compile load eval)
>       (unless t
>         (defsetf foobar setcar)))

FWIW, I don't understand.  Doesn't that just expand to the same code as
before when evaluated?  That code is just evaluated under even more
circumstances.

I would rather try something like

#+begin_src emacs-lisp
(unless t
  (eval '(progn (defalias 'foobar 'cons)
                (defsetf foobar setcar))))
#+end_src

to avoid the eager macro expansion unless the code is actually run.


Michael.





reply via email to

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