[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Default lexical-binding to t
From: |
Stefan Monnier |
Subject: |
Re: Default lexical-binding to t |
Date: |
Wed, 06 Nov 2024 14:26:56 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
>>> What bothers me is how do I know whether a given Lisp file of mine
>>> will have problems under lexical-binding. Do we have any tools which
>>> will help me determine that?
>> It's generally impossible to do that reliably (it can be reduced to
>> a variant of the halting problem), but the problem is exactly the same
>> as that of converting from dynbind to lexbind (which we do describe in
>> the manual).
> How about a less-reliable tool that catches some easy-to-detect problems?
> For example, look in every defun and see if the macro-expanded form of the
> function body refers to a variable that is neither 1) declared with 'defvar'
> or 2) let-bound in that function. This logic might not be exactly what we
> want since I haven't thought very long about it, but something along these
> lines could hopefully catch many errors.
That's what the compiler's warnings give you (plus a few related cases
such as the vars that are let-bound but not used within that let's
lexical scope).
Stefan
- Re: Default lexical-binding to t, (continued)
- Re: Default lexical-binding to t, Dmitry Gutov, 2024/11/07
- Re: Default lexical-binding to t, Eli Zaretskii, 2024/11/08
- Re: Default lexical-binding to t, Alan Mackenzie, 2024/11/08
- Re: Default lexical-binding to t, Eli Zaretskii, 2024/11/08
- Re: Default lexical-binding to t, Alan Mackenzie, 2024/11/08
- Re: Default lexical-binding to t, Stefan Monnier, 2024/11/08
- Re: Default lexical-binding to t, Andrea Corallo, 2024/11/07
- Re: Default lexical-binding to t, Stefan Monnier, 2024/11/08
- Re: Default lexical-binding to t, Sean Whitton, 2024/11/06
- Re: Default lexical-binding to t, Jim Porter, 2024/11/06
- Re: Default lexical-binding to t,
Stefan Monnier <=
- Re: Default lexical-binding to t, John Yates, 2024/11/06
- Re: Default lexical-binding to t, Stefan Monnier, 2024/11/08
- Re: Default lexical-binding to t, Jose A. Ortega Ruiz, 2024/11/06
- Re: Default lexical-binding to t, Stefan Monnier, 2024/11/08
- Re: Default lexical-binding to t, Richard Stallman, 2024/11/06
- Re: Default lexical-binding to t, Eli Zaretskii, 2024/11/07
- Re: Default lexical-binding to t, Richard Stallman, 2024/11/06
Re: Default lexical-binding to t, Christopher Howard, 2024/11/07