[Top][All Lists]

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

Re: Can't M-x compile-defun `edebug' because dynamic variables are false

From: Alan Mackenzie
Subject: Re: Can't M-x compile-defun `edebug' because dynamic variables are falsely taken as lexical.
Date: Thu, 5 Jan 2017 10:54:27 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello, Stefan.

On Wed, Jan 04, 2017 at 05:26:53PM -0500, Stefan Monnier wrote:
> >> In which context do you need/want to do that (I ask because how to do
> >> it (and even if it can be done) depends on the details)?
> > I honestly don't know.  I presume that there will be code (other than
> > the byte compiler) which will want to make a distinction.

> There might, indeed, but it's very rare: in most cases rather than
> determining which kind of binding will happen, you want to decide/impose
> which binding will happen.


> I'm not sure how Common-Lip handles it, but AFAICT there is no
> equivalent to special-variable-p there, so they don't seem to offer
> a way to find out whether a binding will be lexical or dynamic.

> > After (defvar foo), the byte compiler seems able to handle foo as
> > a dynamic variable.  I'm still trying to figure out how,

> The byte-compiler *sees* the defvar, which lets it keep a note
> internally (in a data-structure which keeps track of the current
> context, which also includes information about which vars that are
> let-bound in the surrounding code were bound lexically, so as to know
> when we see a reference to var `foo' whether we should look for `foo' in
> the dynamic context or in the lexical context (and if so, where in that
> context)).

Thanks, I'll have a look at that sometime.

>         Stefan

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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