GNU bug report logs - #13813
24.3.50; eval-and-compile in macro inhibits let-binding of variable

Previous Next

Package: emacs;

Reported by: David Engster <deng <at> randomsample.de>

Date: Mon, 25 Feb 2013 17:01:02 UTC

Severity: normal

Tags: notabug

Found in version 24.3.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 13813 <at> debbugs.gnu.org
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
> 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




This bug report was last modified 12 years and 77 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.