[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of va
From: |
Stefan Monnier |
Subject: |
bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable |
Date: |
Mon, 11 Mar 2013 14:15:17 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> There is a flag called `eieio-error-unsupported-class-tags' which makes
> `eieio-defclass' signal an error if a tag is unsupported. Since
> `eieio-defclass' is the implementation of the `defclass' macro (wrapped
> in `eval-and-comopile'), this flag has no effect if it is set in a
> let-binding. To be specific, the test checks that this
> (let ((eieio-error-unsupported-class-tags t))
> (defclass class-error ()
> ((error-slot :initarg :error-slot
> :badslottag 1))
> "A class with a bad slot tag."))
> is throwing an error.
My opinion (expressed in eieio.el via: "FIXME: Most of this should be
moved to the `defclass' macro.") is that this tag-checking should be done
when expanding the `defclass' macro rather than when running
eieio-defclass. So clearly, your let-binding wouldn't affect it when
the code is byte-compiled (or when it's eagerly macroexpanded).
IOW, to be sure to get what you want, you need to be more explicit, as in:
(let ((eieio-error-unsupported-class-tags t))
(eval '(defclass class-error ()
((error-slot :initarg :error-slot
:badslottag 1))
"A class with a bad slot tag.")))
-- Stefan
- bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable,
Stefan Monnier <=