|
From: | Jim Porter |
Subject: | Re: Default lexical-binding to t |
Date: | Wed, 6 Nov 2024 09:54:06 -0800 |
On 11/5/2024 12:24 PM, Stefan Monnier wrote:
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.
Even if we can't catch 100% of issues, catching 80% of them would make users' lives easier.
[Prev in Thread] | Current Thread | [Next in Thread] |