all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: 13813@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	[thread overview]
Message-ID: <jwv38w1x0zr.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <874nh05bzy.fsf@engster.org> (David Engster's message of "Mon, 25 Feb 2013 22:17:53 +0100")

> 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





  reply	other threads:[~2013-03-11 18:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 16:58 bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable David Engster
2013-02-25 20:53 ` Stefan Monnier
2013-02-25 21:17   ` David Engster
2013-03-11 18:15     ` Stefan Monnier [this message]
2013-03-11 20:57       ` David Engster
2013-03-12  2:48         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv38w1x0zr.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=13813@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.