all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Can't M-x compile-defun `edebug' because dynamic variables are falsely taken as lexical.
Date: Wed, 04 Jan 2017 10:23:16 -0500	[thread overview]
Message-ID: <jwv1swi6elk.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: 20170104133948.GA7373@acm.fritz.box

> Ouch!  There seems to be a clash between symbols (which are global,
> dynamic) and lexical variables (which are local and "invisible"): the
> only way to mark a variable as lexical is at the global level.

Yes, there are some subtleties there.  The main issue is that every
occurrence of an identifier, whether a binding occurrence or a "use" can
be lexical or dynamic, but we don't want the coders to have to
constantly specify which uses and which bindings are lexical and which
are dynamic.  So we offer ways to "mark" symbols are "this one uses
dynamic scoping".  There are 2 such ways:
- *Evaluation* of (defvar VAR VAL . REST) marks this variable as being
  dynamically scoped in all the code that will be compiled in this session.
- *Compilation* of (defvar VAR . REST) marks this variable as being
  dynamically scoped in the current compilation unit.

> (vi) e (special-variable-p 'edebug-breakpoints).
>
> This last returns nil.  This suggests edebug-breakpoints has been bound
> as a lexical variable, rather than a dynamic one.  (There is a defvar
> for it earlier in the file.)  This is surely not right.

special-variable-p only indicates if (defvar VAR VAL . REST) was evaluated.


        Stefan




  reply	other threads:[~2017-01-04 15:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03 14:14 Can't M-x compile-defun `edebug' because dynamic variables are falsely taken as lexical Alan Mackenzie
2017-01-03 18:35 ` Stefan Monnier
2017-01-03 21:32   ` Alan Mackenzie
2017-01-03 21:48     ` Stefan Monnier
2017-01-04 13:39       ` Alan Mackenzie
2017-01-04 15:23         ` Stefan Monnier [this message]
2017-01-04 20:04           ` Alan Mackenzie
2017-01-04 21:49             ` Stefan Monnier
2017-01-04 22:02               ` Alan Mackenzie
2017-01-04 22:26                 ` Stefan Monnier
2017-01-04 22:44                   ` Drew Adams
2017-01-05 10:54                   ` Alan Mackenzie
2020-02-13 16:42             ` Drew Adams
2020-02-13 20:02               ` Stefan Monnier
2020-02-13 20:43                 ` Drew Adams
2020-02-13 22:09                   ` Stefan Monnier
2020-02-14  1:07                     ` Drew Adams
2020-02-14  2:24                       ` Stefan Monnier
2020-02-14 17:25                         ` Drew Adams
2020-02-14 19:19                           ` Stefan Monnier
2020-02-17 18:23                           ` Drew Adams
2020-02-13 22:11                   ` Stefan Monnier
2020-02-14  1:13                     ` Drew Adams

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=jwv1swi6elk.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@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.